aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/class.cpp
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2009-11-24 17:14:34 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2009-11-24 17:14:34 +0000
commit46408eedfff5aa33662cedb6716a20616f3bad31 (patch)
tree3ece8c5de5ce4d520ba30ba02a6773c2c4334c80 /test/SemaCXX/class.cpp
parentd3d5301c44138b92bf01286183f5bf310cdd37cf (diff)
Make sure redeclaration chains are properly linked, even through invalid decls. This fixes PR5415.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89777 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/class.cpp')
-rw-r--r--test/SemaCXX/class.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/SemaCXX/class.cpp b/test/SemaCXX/class.cpp
index d2a8114f7b..302d1d58d3 100644
--- a/test/SemaCXX/class.cpp
+++ b/test/SemaCXX/class.cpp
@@ -110,3 +110,12 @@ struct C4 {
void f(); // expected-note{{previous declaration is here}}
int f; // expected-error{{duplicate member 'f'}}
};
+
+// PR5415 - don't hang!
+struct S
+{
+ void f(); // expected-note 2 {{previous declaration}}
+ // FIXME: the out-of-line error shouldn't be there
+ void S::f() {} // expected-error {{class member cannot be redeclared}} expected-error {{out-of-line}} expected-note {{previous definition}}
+ void f() {} // expected-error {{class member cannot be redeclared}} expected-error {{redefinition}}
+};