aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/constructor.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-10-15 13:21:21 +0000
committerDouglas Gregor <dgregor@apple.com>2010-10-15 13:21:21 +0000
commita6e937ce32474934778346f4d51c3beec40e77ec (patch)
tree34b1e54fd8713891fbb7e5a6666f18a484c49be7 /test/SemaCXX/constructor.cpp
parent2fb985bdda20037bda228628acd4cbaa8a3b36ac (diff)
Diagnose C++ [class.mem]p13-14, where a class member has the same name
as the class itself. Fixes PR7082. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116573 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/constructor.cpp')
-rw-r--r--test/SemaCXX/constructor.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/SemaCXX/constructor.cpp b/test/SemaCXX/constructor.cpp
index 9ef5c98e9e..f3b910d2f5 100644
--- a/test/SemaCXX/constructor.cpp
+++ b/test/SemaCXX/constructor.cpp
@@ -15,7 +15,8 @@ class Foo {
virtual Foo(double); // expected-error{{constructor cannot be declared 'virtual'}}
Foo(long) const; // expected-error{{'const' qualifier is not allowed on a constructor}}
- int Foo(int, int); // expected-error{{constructor cannot have a return type}}
+ int Foo(int, int); // expected-error{{constructor cannot have a return type}} \
+ // expected-error{{member 'Foo' has the same name as its class}}
};
Foo::Foo(const Foo&) { }