summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/class.cpp
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2015-01-17 02:33:17 +0000
committerNico Weber <nicolasweber@gmx.de>2015-01-17 02:33:17 +0000
commit71e377d6eead9cf27bee1b1e3cf5d38175401e89 (patch)
tree80eae167df9240c405ec9a3444442d167590209f /clang/test/SemaCXX/class.cpp
parentb6cb6951351f0d6a7f8bc56d26aba0383ed722c7 (diff)
downloadbcm5719-llvm-71e377d6eead9cf27bee1b1e3cf5d38175401e89.tar.gz
bcm5719-llvm-71e377d6eead9cf27bee1b1e3cf5d38175401e89.zip
If a function decl cannot be merged, mark it as invalid.
Clang currently crashes on class C { C() = default; C() = delete; }; My cunning plan for fixing this was to change the `if (!FnD)` in Parser::ParseCXXInlineMethodDef() to `if (!FnD || FnD->isInvalidDecl)` – but alas, the second constructor decl wasn't marked as invalid. This lets Sema::MergeFunctionDecl() return true on function redeclarations, which leads to them being marked invalid. This also improves error messages when functions are redeclared. llvm-svn: 226365
Diffstat (limited to 'clang/test/SemaCXX/class.cpp')
-rw-r--r--clang/test/SemaCXX/class.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/test/SemaCXX/class.cpp b/clang/test/SemaCXX/class.cpp
index 636f584cf62..a6694403a68 100644
--- a/clang/test/SemaCXX/class.cpp
+++ b/clang/test/SemaCXX/class.cpp
@@ -119,9 +119,9 @@ struct C4 {
// PR5415 - don't hang!
struct S
{
- void f(); // expected-note 1 {{previous declaration}}
- void S::f() {} // expected-error {{extra qualification on member}} expected-error {{class member cannot be redeclared}} expected-note {{previous declaration}} expected-note {{previous definition}}
- void f() {} // expected-error {{class member cannot be redeclared}} expected-error {{redefinition}}
+ void f(); // expected-note 1 {{previous declaration}} expected-note {{previous declaration}}
+ void S::f() {} // expected-error {{extra qualification on member}} expected-error {{class member cannot be redeclared}}
+ void f() {} // expected-error {{class member cannot be redeclared}}
};
// Don't crash on this bogus code.
OpenPOWER on IntegriCloud