Index: include/clang/Basic/DiagnosticSemaKinds.td
===================================================================
--- include/clang/Basic/DiagnosticSemaKinds.td	(revision 160569)
+++ include/clang/Basic/DiagnosticSemaKinds.td	(working copy)
@@ -2075,6 +2075,9 @@
   "static and non-static member functions with the same parameter types "
   "cannot be overloaded">;
 
+def err_invalid_qualified_operator_newdelete : Error<
+  "%0 cannot have cv-qualifiers">;
+
 def err_ovl_no_viable_function_in_call : Error<
   "no matching function for call to %0">;
 def err_ovl_no_viable_member_function_in_call : Error<
Index: lib/Sema/SemaDeclCXX.cpp
===================================================================
--- lib/Sema/SemaDeclCXX.cpp	(revision 160569)
+++ lib/Sema/SemaDeclCXX.cpp	(working copy)
@@ -9219,6 +9219,16 @@
     return SemaRef.Diag(FnDecl->getLocation(), InvalidParamTypeDiag)
     << FnDecl->getDeclName() << ExpectedFirstParamType;
   
+  // Check that the function does not have any cv-qualifiers (because the 
+  // operator is implicitly static even if not declared as such, and according 
+  // to [class.static.mfct]p2: "A static member function shall not be declared 
+  // const, volatile, or const volatile.
+  const FunctionProtoType *Fn = FnDecl->getType()->getAs<FunctionProtoType>();
+  if (Fn && Fn->getTypeQuals() != 0)
+    return SemaRef.Diag(FnDecl->getLocation(), 
+                        diag::err_invalid_qualified_operator_newdelete)
+      << FnDecl->getDeclName();
+
   return false;
 }
 
Index: test/SemaCXX/overloaded-operator.cpp
===================================================================
--- test/SemaCXX/overloaded-operator.cpp	(revision 160569)
+++ test/SemaCXX/overloaded-operator.cpp	(working copy)
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s 
+// RUN: %clang_cc1 -fsyntax-only -verify %s
 class X { };
 
 X operator+(X, X);
@@ -72,8 +72,8 @@
 
 void enum_test(Enum1 enum1, Enum2 enum2, E1 e1, E2 e2, Enum1 next_enum1) {
   float &f1 = (e1 == e2);
-  float &f2 = (enum1 == e2); 
-  float &f3 = (e1 == enum2); 
+  float &f2 = (enum1 == e2);
+  float &f3 = (e1 == enum2);
   float &f4 = (enum1 == next_enum1);  // expected-error{{non-const lvalue reference to type 'float' cannot bind to a temporary of type 'bool'}}
 }
 
@@ -129,7 +129,7 @@
   long& operator*() const volatile;
 };
 
-void test_smartptr(SmartPtr ptr, const SmartPtr cptr, 
+void test_smartptr(SmartPtr ptr, const SmartPtr cptr,
                    const volatile SmartPtr cvptr) {
   int &ir = *ptr;
   long &lr = *cptr;
@@ -187,7 +187,7 @@
   int &ir2 = c2();
   int &ir3 = c2(1);
   double &fr2 = c2c();
-  
+
   int &ir4 = dc(17);
   double &fr3 = dc(3.14159f);
 }
@@ -265,13 +265,13 @@
 bool x(BB y, BB z) { return y != z; }
 
 
-struct AX { 
+struct AX {
   AX& operator ->();	 // expected-note {{declared here}}
   int b;
-}; 
+};
 
 void m() {
-  AX a; 
+  AX a;
   a->b = 0; // expected-error {{circular pointer delegation detected}}
 }
 
@@ -415,3 +415,14 @@
   void f(int);
   void g() { A x; x = f; }
 }
+
+namespace PR13481 {
+  struct A {
+    void *operator new(unsigned int) const { // expected-error {{'operator new' cannot have cv-qualifiers}}
+      return (void *)0;
+    }
+
+    void operator delete(void *) const { // expected-error {{'operator delete' cannot have cv-qualifiers}}
+    }
+  };
+}
