forked from OSchip/llvm-project
6c03cfb091
The code pattern used to implement the token rewriting hack doesn't interact well with token caching in the pre-processor. As a result, clang would crash on 'int f(::(id));' while doing a tenative parse of the contents of the outer parentheses. The original code from PR11852 still doesn't crash the compiler. This error recovery also often does the wrong thing with member function pointers. The test case from the original PR doesn't recover the right way either: void S::(*pf)() = S::f; // should be 'void (S::*pf)()' Instead we were recovering as 'void S::*pf()', which is still wrong. If we still think that users mistakenly parenthesize identifiers in nested name specifiers, we should change clang to intentionally parse that form with an error, rather than doing a token rewrite. Fixes PR26623, but I think there will be many more bugs like this around token rewriting in the parser. Reviewers: rsmith, rtrieu Differential Revision: https://reviews.llvm.org/D25882 llvm-svn: 289273 |
||
---|---|---|
.. | ||
CMakeLists.txt | ||
ParseAST.cpp | ||
ParseCXXInlineMethods.cpp | ||
ParseDecl.cpp | ||
ParseDeclCXX.cpp | ||
ParseExpr.cpp | ||
ParseExprCXX.cpp | ||
ParseInit.cpp | ||
ParseObjc.cpp | ||
ParseOpenMP.cpp | ||
ParsePragma.cpp | ||
ParseStmt.cpp | ||
ParseStmtAsm.cpp | ||
ParseTemplate.cpp | ||
ParseTentative.cpp | ||
Parser.cpp | ||
RAIIObjectsForParser.h |