[llvm-branch-commits] [cfe-branch] r150468 - in /cfe/branches/tooling: ./ lib/Parse/ParseDeclCXX.cpp test/SemaCXX/member-init.cpp test/SemaCXX/warn-unreachable.cpp
Manuel Klimek
klimek at google.com
Tue Feb 14 01:48:44 PST 2012
Author: klimek
Date: Tue Feb 14 03:48:44 2012
New Revision: 150468
URL: http://llvm.org/viewvc/llvm-project?rev=150468&view=rev
Log:
Merging mainline.
Modified:
cfe/branches/tooling/ (props changed)
cfe/branches/tooling/lib/Parse/ParseDeclCXX.cpp
cfe/branches/tooling/test/SemaCXX/member-init.cpp
cfe/branches/tooling/test/SemaCXX/warn-unreachable.cpp (props changed)
Propchange: cfe/branches/tooling/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Feb 14 03:48:44 2012
@@ -1,3 +1,3 @@
/cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:146581-150463
+/cfe/trunk:146581-150467
/cfe/trunk/test/SemaTemplate:126920
Modified: cfe/branches/tooling/lib/Parse/ParseDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Parse/ParseDeclCXX.cpp?rev=150468&r1=150467&r2=150468&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Parse/ParseDeclCXX.cpp (original)
+++ cfe/branches/tooling/lib/Parse/ParseDeclCXX.cpp Tue Feb 14 03:48:44 2012
@@ -1989,11 +1989,12 @@
// declarator is followed by an initializer.
//
// A brace-or-equal-initializer for a member-declarator is not an
- // initializer in the gramamr, so this is ill-formed.
+ // initializer in the grammar, so this is ill-formed.
Diag(Tok, diag::err_incomplete_array_member_init);
SkipUntil(tok::comma, true, true);
- // Avoid later warnings about a class member of incomplete type.
- ThisDecl->setInvalidDecl();
+ if (ThisDecl)
+ // Avoid later warnings about a class member of incomplete type.
+ ThisDecl->setInvalidDecl();
} else
ParseCXXNonStaticMemberInitializer(ThisDecl);
} else if (HasInitializer) {
Modified: cfe/branches/tooling/test/SemaCXX/member-init.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/member-init.cpp?rev=150468&r1=150467&r2=150468&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/member-init.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/member-init.cpp Tue Feb 14 03:48:44 2012
@@ -29,6 +29,9 @@
struct S {
int as[] = { decltype(x)::B<C, D>(0) }; // expected-error {{array bound cannot be deduced from an in-class initializer}}
T<sizeof(as) / sizeof(int)> x; // expected-error {{requires a type specifier}}
+ // test that we handle invalid array bound deductions without crashing when the declarator name is itself invalid
+ operator int[](){}; // expected-error {{'operator int' cannot be the name of a variable or data member}} \
+ // expected-error {{array bound cannot be deduced from an in-class initializer}}
};
struct ThrowCtor { ThrowCtor(int) noexcept(false); };
Propchange: cfe/branches/tooling/test/SemaCXX/warn-unreachable.cpp
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Feb 14 03:48:44 2012
@@ -1,2 +1,2 @@
/cfe/branches/type-system-rewrite/test/SemaCXX/warn-unreachable.cpp:134693-134817
-/cfe/trunk/test/SemaCXX/warn-unreachable.cpp:121961,146581-150463
+/cfe/trunk/test/SemaCXX/warn-unreachable.cpp:121961,146581-150467
More information about the llvm-branch-commits
mailing list