aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Parse/ParseCXXInlineMethods.cpp2
-rw-r--r--test/Parser/PR11000.cpp9
2 files changed, 10 insertions, 1 deletions
diff --git a/lib/Parse/ParseCXXInlineMethods.cpp b/lib/Parse/ParseCXXInlineMethods.cpp
index 0ca249fd1a..923a5587e6 100644
--- a/lib/Parse/ParseCXXInlineMethods.cpp
+++ b/lib/Parse/ParseCXXInlineMethods.cpp
@@ -453,7 +453,7 @@ void Parser::ParseLexedMemberInitializers(ParsingClass &Class) {
}
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
diff --git a/test/Parser/PR11000.cpp b/test/Parser/PR11000.cpp
new file mode 100644
index 0000000000..41c62060a4
--- /dev/null
+++ b/test/Parser/PR11000.cpp
@@ -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.