diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp index 0a773719eb1b..eb38eee8d5c6 100644 --- a/clang/lib/Sema/SemaOverload.cpp +++ b/clang/lib/Sema/SemaOverload.cpp @@ -326,7 +326,7 @@ Sema::IsOverload(FunctionDecl *New, Decl* OldD, CXXMethodDecl* NewMethod = dyn_cast(New); if (OldMethod && NewMethod && !OldMethod->isStatic() && !NewMethod->isStatic() && - OldQType.getCVRQualifiers() != NewQType.getCVRQualifiers()) + OldMethod->getTypeQualifiers() != NewMethod->getTypeQualifiers()) return true; // The signatures match; this is not an overload. diff --git a/clang/test/SemaCXX/overload-decl.cpp b/clang/test/SemaCXX/overload-decl.cpp index 872a180e96c6..9b0d0e205e7f 100644 --- a/clang/test/SemaCXX/overload-decl.cpp +++ b/clang/test/SemaCXX/overload-decl.cpp @@ -16,9 +16,7 @@ int g(); // expected-error {{error: functions that differ only in their return t class X { void f(); void f(int); - - // FIXME: can't test this until we can handle const methods. - // void f() const; + void f() const; void g(int); // expected-error {{error: previous declaration is here}} void g(int, float); // expected-error {{error: previous declaration is here}} diff --git a/clang/test/SemaCXX/overloaded-operator.cpp b/clang/test/SemaCXX/overloaded-operator.cpp index ba9c60ccd95a..98f0bb07f6ac 100644 --- a/clang/test/SemaCXX/overloaded-operator.cpp +++ b/clang/test/SemaCXX/overloaded-operator.cpp @@ -90,12 +90,14 @@ void incdec_test(PostInc pi, PostDec pd) { struct SmartPtr { int& operator*(); - // FIXME: spurious error: long& operator*() const; + 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; - // FIXME: reinstate long &lr = *cptr; + long &lr = *cptr; + long &lr2 = *cvptr; }