llvm-project/clang/test
Reid Kleckner 6c03cfb091 Remove special error recovery for ::(id)
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
2016-12-09 21:10:43 +00:00
..
ARCMT [test/objcmt] Add a follow-up test case for r275600. 2016-07-15 20:40:24 +00:00
ASTMerge Fixed layout of test/ASTMerge. 2016-11-16 18:21:00 +00:00
Analysis [analyzer] Add dispatch_data_create as a special case in RetainCountChecker. 2016-12-08 14:05:48 +00:00
CXX Improve error message when referencing a non-tag type with a tag 2016-12-09 19:47:58 +00:00
CodeCompletion Fix heuristics skipping invalid ctor-initializers with C++11 2016-11-03 07:36:17 +00:00
CodeGen [DebugInfo] Relax test case for long double constants. 2016-12-08 21:15:17 +00:00
CodeGenCUDA [CUDA] Improve target attribute checking for function templates. 2016-12-07 19:27:16 +00:00
CodeGenCXX [c++1z] P0003R5: Removing dynamic exception specifications. 2016-12-08 02:49:07 +00:00
CodeGenCoroutines [coroutines] Add allocation and deallocation substatements. 2016-10-27 16:28:31 +00:00
CodeGenObjC Switch CGObjCMac to use ConstantInitBuilder. Whew. 2016-11-30 02:39:18 +00:00
CodeGenObjCXX Forward ns_consumed delegate arguments with a move. 2016-11-18 01:08:24 +00:00
CodeGenOpenCL Add support for non-zero null pointer for C and OpenCL 2016-12-09 19:01:11 +00:00
Coverage Make output of -ast-print a valid C++ code. 2016-11-10 08:49:37 +00:00
CoverageMapping [Coverage] Support for C++17 if initializers 2016-10-14 23:38:16 +00:00
Driver [sanitizers] lsan+sancov doesn't need ubsanrt (multi def error) 2016-12-08 22:25:01 +00:00
FixIt Warn when 'assume_nonnull' infers nullability within an array. 2016-11-10 23:28:30 +00:00
Format Make clang-format remove duplicate headers when sorting #includes. 2016-08-10 09:32:23 +00:00
Frontend [Frontend] Fix an issue where a quoted search path is incorrectly 2016-12-02 09:51:51 +00:00
Headers [Headers] Add #include_next for tgmath.h on Darwin 2016-12-09 03:30:46 +00:00
Index [CodeCompletion][ObjC] Use a parameterized NSSet return type for 2016-12-08 16:49:05 +00:00
Integration
Layout [MS ABI] Implement __declspec(empty_bases) and __declspec(layout_version) 2016-05-23 17:16:12 +00:00
Lexer p0012r1: define corresponding feature test macro 2016-12-02 02:02:23 +00:00
Misc Store decls in prototypes on the declarator instead of in the AST 2016-12-09 17:14:05 +00:00
Modules [CrashReproducer] Provide a clean dir path for -fmodules-cache-path 2016-12-09 03:11:48 +00:00
OpenMP [OpenMP] Sema and parsing for 'teams distribute parallel for' pragma 2016-12-09 03:24:30 +00:00
PCH Relax IRgen check in decl-in-prototype.c to match signext on PPC64 2016-12-09 17:56:04 +00:00
Parser Remove special error recovery for ::(id) 2016-12-09 21:10:43 +00:00
Preprocessor Also recognize -std=iso9899:201x 2016-12-06 10:23:07 +00:00
Profile Add test for D21736. 2016-11-22 20:03:40 +00:00
Rewriter Specify -std=gnu++98 on some Rewriter tests. NFC. 2016-12-09 01:20:40 +00:00
Sema Store decls in prototypes on the declarator instead of in the AST 2016-12-09 17:14:05 +00:00
SemaCUDA [CUDA] Ignore implicit target attributes during function template instantiation. 2016-12-08 19:38:13 +00:00
SemaCXX Improve error message when referencing a non-tag type with a tag 2016-12-09 19:47:58 +00:00
SemaObjC DR616, and part of P0135R1: member access (or pointer-to-member access) on a 2016-12-03 01:14:32 +00:00
SemaObjCXX [ObjC++] Don't enter a C++ declarator scope when the current context is 2016-12-07 10:24:44 +00:00
SemaOpenCL [OpenCL] Refactor read_only/write_only pipes. 2016-12-01 11:30:49 +00:00
SemaTemplate Improve error message when referencing a non-tag type with a tag 2016-12-09 19:47:58 +00:00
TableGen
Tooling
Unit
VFS Don't diagnose non-modular includes when we are not compiling a module. 2016-08-26 17:16:46 +00:00
.clang-format
CMakeLists.txt [test] Fix detecting LLVM zlib support in stand-alone builds 2016-11-01 20:31:52 +00:00
TestRunner.sh
cxx-sections.data
lit.cfg [test] Correctly include build llvm_shlib_dir in stand-alone builds 2016-11-15 12:54:10 +00:00
lit.site.cfg.in XFAIL Driver/darwin-stdlib.cpp if CLANG_DEFAULT_CXX_STDLIB is set 2016-09-29 07:43:08 +00:00
make_test_dirs.pl