[cfe-commits] r140802 - in /cfe/trunk: lib/Parse/ParseCXXInlineMethods.cpp test/Parser/PR11000.cpp
Richard Smith
richard-llvm at metafoo.co.uk
Thu Sep 29 12:42:28 PDT 2011
Author: rsmith
Date: Thu Sep 29 14:42:27 2011
New Revision: 140802
URL: http://llvm.org/viewvc/llvm-project?rev=140802&view=rev
Log:
PR11000: Fix crash on invalid.
Added:
cfe/trunk/test/Parser/PR11000.cpp
Modified:
cfe/trunk/lib/Parse/ParseCXXInlineMethods.cpp
Modified: cfe/trunk/lib/Parse/ParseCXXInlineMethods.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseCXXInlineMethods.cpp?rev=140802&r1=140801&r2=140802&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseCXXInlineMethods.cpp (original)
+++ cfe/trunk/lib/Parse/ParseCXXInlineMethods.cpp Thu Sep 29 14:42:27 2011
@@ -453,7 +453,7 @@
}
void Parser::ParseLexedMemberInitializer(LateParsedMemberInitializer &MI) {
- if (MI.Field->isInvalidDecl())
+ if (!MI.Field || MI.Field->isInvalidDecl())
return;
// Append the current token at the end of the new token stream so that it
Added: cfe/trunk/test/Parser/PR11000.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/PR11000.cpp?rev=140802&view=auto
==============================================================================
--- cfe/trunk/test/Parser/PR11000.cpp (added)
+++ cfe/trunk/test/Parser/PR11000.cpp Thu Sep 29 14:42:27 2011
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -std=c++0x %s 2>&1 | FileCheck %s
+
+// PR11000: Don't crash.
+class tuple<>
+{
+ template <class _Alloc>
+ tuple(allocator_arg_t, const _Alloc&) {}
+
+// CHECK: 6 errors generated.
More information about the cfe-commits
mailing list