aboutsummaryrefslogtreecommitdiff
path: root/test/CXX/class
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-04-29 07:31:09 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-04-29 07:31:09 +0000
commite531001b7e44bee5c4ec0be93efbc75adb37a0e3 (patch)
treeb7fd54f429db25129df54696a581680305094ede /test/CXX/class
parenta2e76f56c60dbd4de3dc0fed02bb01bea4dcff81 (diff)
PR12688: ParseCXXClassMemberDeclaration's sometimes-null ThisDecl takes another
victim. Don't crash if we have a delay-parsed exception specification for a class member which is invalid in a way which precludes building a FunctionDecl. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155788 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CXX/class')
-rw-r--r--test/CXX/class/class.mem/p2.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/CXX/class/class.mem/p2.cpp b/test/CXX/class/class.mem/p2.cpp
index bf7b3d49c9..02ef9d7bbc 100644
--- a/test/CXX/class/class.mem/p2.cpp
+++ b/test/CXX/class/class.mem/p2.cpp
@@ -73,3 +73,16 @@ namespace PR12629 {
static_assert(!noexcept(S().h()), "");
static_assert(noexcept(S::i()), "");
}
+
+namespace PR12688 {
+ struct S {
+ // FIXME: Producing one error saying this can't have the same name
+ // as the class because it's not a constructor, then producing
+ // another error saying this can't have a return type because
+ // it is a constructor, is redundant and inconsistent.
+ nonsense S() throw (more_nonsense); // \
+ // expected-error {{'nonsense'}} \
+ // expected-error {{has the same name as its class}} \
+ // expected-error {{constructor cannot have a return type}}
+ };
+}