aboutsummaryrefslogtreecommitdiff
path: root/test/Parser/PR21872.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2014-12-18 09:57:31 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2014-12-18 09:57:31 +0000
commit24e943ea0e1694ac57f3cd70024f8e38adea5bdb (patch)
tree5cd2cb8ee809293ae268f9ff51f9d50db5e35f6b /test/Parser/PR21872.cpp
parent9b8aa02e2afac5b5463a6d265454a84df5f1e4b6 (diff)
Parse: Don't parse after the eof has been consumed
ParseCXXNonStaticMemberInitializer stashes away all the tokens for the initializer and an additional EOF token to denote where the initializer ends. However, it is possible for ParseLexedMemberInitializer to get its hands on the "real" EOF token; since the two tokens are indistinguishable, we end up consuming the EOF and descend into madness. Instead, make it possible to tell which EOF token we are looking at. This fixes PR21872. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224505 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Parser/PR21872.cpp')
-rw-r--r--test/Parser/PR21872.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/Parser/PR21872.cpp b/test/Parser/PR21872.cpp
new file mode 100644
index 0000000000..ae0a13d9c1
--- /dev/null
+++ b/test/Parser/PR21872.cpp
@@ -0,0 +1,4 @@
+// RUN: not %clang_cc1 -fsyntax-only %s
+template <typename T> struct S {
+ int k = ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
+int f;