Place constructors and destructors into the DeclContext of the class,
just like all other members, and remove the special variables in
CXXRecordDecl to store them. This eliminates a lot of special-case
code for constructors and destructors, including
ActOnConstructor/ActOnDeclarator and special lookup rules in
LookupDecl. The result is far more uniform and manageable.
Diagnose the redeclaration of member functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61048 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/overload-decl.cpp b/test/SemaCXX/overload-decl.cpp
index 9814725..96378ba 100644
--- a/test/SemaCXX/overload-decl.cpp
+++ b/test/SemaCXX/overload-decl.cpp
@@ -13,11 +13,15 @@
void g(void); // expected-note {{previous declaration is here}}
int g(); // expected-error {{functions that differ only in their return type cannot be overloaded}}
+typedef int INT;
+
class X {
void f();
- void f(int);
+ void f(int); // expected-note {{previous declaration is here}}
void f() const;
+ void f(INT); // expected-error{{cannot be redeclared}}
+
void g(int); // expected-note {{previous declaration is here}}
void g(int, float); // expected-note {{previous declaration is here}}
int g(int, Float); // expected-error {{functions that differ only in their return type cannot be overloaded}}