]> granicus.if.org Git - clang/commit
When "delayed parsing" C++ default arguments, if there is an error, there may be...
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 30 Mar 2010 22:14:32 +0000 (22:14 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 30 Mar 2010 22:14:32 +0000 (22:14 +0000)
commit7fd3a6456a88cdd225b92ae1606144f24c7f51d4
tree6b296f963187dd660d103c1bb2bcdd62be09760d
parent3be9678105f10c49c4ebc5ce353f770c3a50f9c7
When "delayed parsing" C++ default arguments, if there is an error, there may be tokens left in the token stream
that will interfere (they will be parsed as if they are after the class' '}') and a crash will occur because
the CachedTokens that holds them will be deleted while the lexer is still using them.

Make sure that the tokens of default args are removed from the token stream.
Fixes PR6647.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99939 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Parse/ParseCXXInlineMethods.cpp
test/Parser/cxx-default-args.cpp [new file with mode: 0644]