]> granicus.if.org Git - clang/commit
Parse: Don't parse after the eof has been consumed
authorDavid Majnemer <david.majnemer@gmail.com>
Thu, 18 Dec 2014 09:57:31 +0000 (09:57 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Thu, 18 Dec 2014 09:57:31 +0000 (09:57 +0000)
commit24e943ea0e1694ac57f3cd70024f8e38adea5bdb
tree5cd2cb8ee809293ae268f9ff51f9d50db5e35f6b
parent9b8aa02e2afac5b5463a6d265454a84df5f1e4b6
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
include/clang/Lex/Token.h
lib/Parse/ParseCXXInlineMethods.cpp
test/Parser/PR21872.cpp [new file with mode: 0644]