llvm-project/clang/test/Parser
Richard Smith ac63d63543 Add a "vexing parse" warning for ambiguity between a variable declaration and a
function-style cast.

This fires for cases such as

  T(x);

... where 'x' was previously declared and T is a type. This construct declares
a variable named 'x' rather than the (probably expected) interpretation of a
function-style cast of 'x' to T.

llvm-svn: 314570
2017-09-29 23:57:25 +00:00
..
CompoundStmtScope.c
DelayedTemplateParsing.cpp If a function decl cannot be merged, mark it as invalid. 2015-01-17 02:33:17 +00:00
MicrosoftExtensions.c [Parse] Let declarations follow labels in -fms-extensions mode 2016-08-01 16:39:29 +00:00
MicrosoftExtensions.cpp Keep the IdentifierInfo in the Token for alternative operator keyword 2017-07-14 09:23:40 +00:00
MicrosoftExtensionsInlineAsm.c This test case does not require -Wno-missing-declarations or -x objective-c++. 2014-07-06 19:44:38 +00:00
PR11000.cpp Add 'not' to commands that are expected to fail. 2013-07-04 16:16:58 +00:00
PR21872.cpp Parse: Don't parse after the eof has been consumed 2014-12-18 09:57:31 +00:00
access-spec-attrs.cpp Sema: attribute((annotate)) must have at least one argument 2014-12-14 01:05:01 +00:00
altivec-csk-bool.c Remove the -faltivec alias option and replace it with -maltivec everywhere. 2017-03-21 22:06:18 +00:00
altivec.c Remove the -faltivec alias option and replace it with -maltivec everywhere. 2017-03-21 22:06:18 +00:00
annotation-token-in-lexed-body.cpp Parse: Don't assume tokens have a length 2015-03-19 00:10:23 +00:00
argument_qualified.c
argument_redef.c
argument_scope.c
arm-windows-calling-convention-handling.c [AArch64] Ignore stdcall and similar on aarch64/windows 2017-08-07 20:52:04 +00:00
asm-constraints-pr7869.c
asm.c Parse: Avoid crashing on unterminated top-level asm strings 2013-12-10 21:29:48 +00:00
asm.cpp Parse: Concatenated string literals should be verified in inline asm 2014-12-11 01:00:48 +00:00
atomic.c [parser] Push _Atomic locs through DeclaratorChunk. 2015-03-29 16:42:06 +00:00
attr-availability.c Parse: Diagnose malformed 'message' arguments for 'availability' attr 2014-07-18 05:43:12 +00:00
attr-external-source-symbol-cxx11.cpp Introduce an 'external_source_symbol' attribute that describes the origin 2017-03-01 18:06:25 +00:00
attr-external-source-symbol.m Introduce an 'external_source_symbol' attribute that describes the origin 2017-03-01 18:06:25 +00:00
attributes.c Uniformed parsing of GNU attributes at line beginnning and added GNU attributes parsing FIXMEs. 2014-08-16 08:29:27 +00:00
attributes.mm Revert "Don't require -re suffix on -verify directives with regexes." 2013-12-14 01:07:05 +00:00
backtrack-crash.cpp
backtrack-off-by-one.cpp PR0091R3: Implement parsing support for using templates as types. 2017-01-26 20:40:47 +00:00
bad-control.c Fix to PR8880 (clang dies processing a for loop) 2014-01-23 15:05:00 +00:00
block-block-storageclass.c
block-pointer-decl.c
bracket-crash.cpp
brackets.c Adjust the wording of the "brackets go after the unqualified-id" error message. It applies in cases that aren't unqualified-ids. 2015-05-01 20:47:19 +00:00
brackets.cpp Adjust the wording of the "brackets go after the unqualified-id" error message. It applies in cases that aren't unqualified-ids. 2015-05-01 20:47:19 +00:00
builtin_classify_type.c Replace "can not" with "cannot" in diagnostics messages. 2014-03-07 22:36:23 +00:00
builtin_types_compatible.c
c-namespace.c
c1x-alignas.c Switch C compilations to C11 by default. 2014-10-20 23:26:58 +00:00
c1x-generic-selection.c
c11-noreturn.c Improve diagnostics if _Noreturn is placed after a function declarator. (This sometimes happens when a macro is used that expands to either the GNU noreturn attribute or _Noreturn.) 2014-11-10 21:10:32 +00:00
captured-statements.c
char-literal-printing.c
check-objc2-syntax-1.m [Parser] Remove "add -fmodules" from the "use of '@import' when modules are disabled, add -fmodules" error. 2014-04-17 02:32:52 +00:00
check-syntax-1.m
check_cast.c
colon-colon-parentheses.cpp Remove special error recovery for ::(id) 2016-12-09 21:10:43 +00:00
completely-empty-header-file.h
compound_literal.c Replace completely bogus ambiguous-compound-literal-in-C++ code with something 2014-05-15 02:51:15 +00:00
control-scope.c
crash-report.c Fix REQUIRES lines on tests from r228735. Thanks Kristof for pointing out the missing commas 2015-02-11 19:45:13 +00:00
cuda-force-host-device-templates.cu [CUDA] Rework tests now that we emit deferred diagnostics during sema. Test-only change. 2016-10-19 00:06:49 +00:00
cuda-force-host-device.cu [CUDA] Add #pragma clang force_cuda_host_device_{begin,end} pragmas. 2016-10-08 22:15:58 +00:00
cuda-kernel-call-c++11.cu Fix PR20081: Parsing templates in the presence of -x cuda -std=c++11 2014-06-20 13:09:59 +00:00
cuda-kernel-call.cu Fix PR20081: Parsing templates in the presence of -x cuda -std=c++11 2014-06-20 13:09:59 +00:00
cxx-altivec.cpp Remove the -faltivec alias option and replace it with -maltivec everywhere. 2017-03-21 22:06:18 +00:00
cxx-ambig-decl-expr-xfail.cpp Add a PR reference for XFAILed test 2014-05-28 12:26:32 +00:00
cxx-ambig-decl-expr.cpp
cxx-ambig-init-templ.cpp __declspec is not a core Clang language extension. Instead, require -fms-extensions or -fborland to enable the language extension. 2015-05-26 19:44:52 +00:00
cxx-ambig-paren-expr-asan.cpp PR23057: fix use-after-free due to local token buffer in ParseCXXAmbiguousParenExpression, by Dmitry Polukhin 2016-02-04 04:22:09 +00:00
cxx-ambig-paren-expr.cpp Fix regression from r259622: the operand of an increment that is the operand of 2016-02-03 18:48:43 +00:00
cxx-attributes.cpp Parse: __attribute__((keyword)) shouldn't error 2015-01-03 19:41:00 +00:00
cxx-bool.cpp Properly parse a postfix expression following a Boolean literal. Fixes PR34273. 2017-09-28 21:29:18 +00:00
cxx-casting.cpp Warn when a reference is bound to an empty l-value (dereferenced null pointer). 2016-05-14 17:44:14 +00:00
cxx-class-template-specialization.cpp
cxx-class.cpp Lit C++11 Compatibility Patch #8 2016-04-14 23:47:07 +00:00
cxx-concept-declaration.cpp [Concepts] Add diagnostic: non template declaration 2015-07-30 21:20:55 +00:00
cxx-concepts-ambig-constraint-expr.cpp [Concepts] Parsing of requires-clause in template-declaration 2015-06-25 00:23:39 +00:00
cxx-concepts-requires-clause.cpp [Concepts] Parsing of requires-clause in template-declaration 2015-06-25 00:23:39 +00:00
cxx-condition.cpp
cxx-decl.cpp Lit C++11 Compatibility Patch #8 2016-04-14 23:47:07 +00:00
cxx-default-args.cpp Parse: Don't crash when default argument in typedef consists of sole '=' 2015-01-13 07:42:33 +00:00
cxx-default-delete.cpp When we see something that looks like a constructor with a return type, only issue one error, not two. 2015-07-06 01:04:39 +00:00
cxx-ext-delete-default.cpp
cxx-extern-c-array.cpp
cxx-extra-semi.cpp Revert "clang/test/Driver/crash-report.c: This requires rewriter for -frewrite-includes. [PR20321]" 2014-07-16 15:12:48 +00:00
cxx-friend.cpp Lit C++11 Compatibility Patch #8 2016-04-14 23:47:07 +00:00
cxx-in-c.c
cxx-invalid-for-range.cpp PR23057: Fix assertion `Val && "isa<> used on a null pointer"' on invalid for-range expression. 2016-02-02 17:33:09 +00:00
cxx-invalid-function-decl.cpp Fix infinite loop when ::new or ::delete are found in member initializer list, by Denis Zobnin 2016-01-20 05:25:51 +00:00
cxx-member-crash.cpp Add 'not' to commands that are expected to fail. 2013-07-04 16:16:58 +00:00
cxx-member-init-missing-paren-crash.cpp
cxx-member-initializers.cpp Parse: use the EOF token method to lex inline method bodies 2015-01-13 05:06:20 +00:00
cxx-modules-interface.cppm [modules ts] Diagnose 'export' declarations outside of a module interface. 2017-04-24 23:12:30 +00:00
cxx-namespace-alias.cpp
cxx-reference.cpp [Lit Test] Updated 20 Lit tests to be C++11 compatible. 2015-12-10 01:07:17 +00:00
cxx-stmt.cpp
cxx-template-argument.cpp When a type-id is unexpectedly given a name, assume that the name is unrelated 2017-05-19 01:54:59 +00:00
cxx-template-decl.cpp Diagnose attempts to explicitly instantiate a template at class scope. Previously Clang would simply ignore the 'template' keyword in this case. 2017-02-09 22:14:25 +00:00
cxx-throw.cpp
cxx-typeid.cpp
cxx-typeof.cpp [Lit Test] Updated 20 Lit tests to be C++11 compatible. 2015-12-10 01:07:17 +00:00
cxx-undeclared-identifier.cpp
cxx-using-declaration.cpp Replace "can not" with "cannot" in diagnostics messages. 2014-03-07 22:36:23 +00:00
cxx-using-directive.cpp Allow CorrectTypo to replace CXXScopeSpecifiers that refer to classes. 2013-10-19 00:05:00 +00:00
cxx-variadic-func.cpp Revert "Improve declaration / expression disambiguation around ptr-operators, and use" 2015-02-23 22:36:28 +00:00
cxx0x-ambig.cpp Fix valid-for-expr ellipses eaten as invalid decl 2017-05-20 00:21:55 +00:00
cxx0x-attributes.cpp Replace remaining user-visible mentions of C++1z with C++17. 2017-08-13 22:26:53 +00:00
cxx0x-condition.cpp Add a "vexing parse" warning for ambiguity between a variable declaration and a 2017-09-29 23:57:25 +00:00
cxx0x-decl.cpp When a type-id is unexpectedly given a name, assume that the name is unrelated 2017-05-19 01:54:59 +00:00
cxx0x-for-range.cpp Revised wording for diagnostics in r208299 2014-05-09 09:49:29 +00:00
cxx0x-in-cxx98.cpp PR21367: Don't accept rvalue references as an extension in C++98 mode if we're in a new-type-id or conversion-type-id, since those things can legitimately be followed by a binary && operator. 2014-10-28 16:55:02 +00:00
cxx0x-lambda-expressions.cpp N3922: direct-list-initialization of an auto-typed variable no longer deduces a 2015-11-11 01:36:17 +00:00
cxx0x-literal-operators.cpp
cxx0x-member-initializers.cpp PR19993: don't assert/crash if a static data member is initialized by '= delete;'. 2014-06-11 00:49:52 +00:00
cxx0x-override-control-keywords.cpp Remove obsolete FIXME. override on definitions is fine. 2015-03-03 03:31:15 +00:00
cxx0x-rvalue-reference.cpp PR13110: Add a -Wignored-qualifiers warning when ignoring a const, volatile, or 2014-02-19 00:13:27 +00:00
cxx1z-attributes.cpp Fix several accidental DOS line endings in source files 2016-01-03 15:55:40 +00:00
cxx1z-class-template-argument-deduction.cpp Add a "vexing parse" warning for ambiguity between a variable declaration and a 2017-09-29 23:57:25 +00:00
cxx1z-constexpr-lambdas.cpp Replace remaining user-visible mentions of C++1z with C++17. 2017-08-13 22:26:53 +00:00
cxx1z-coroutines.cpp [coroutines] Rename driver flag -fcoroutines to -fcoroutines-ts 2016-10-02 03:31:58 +00:00
cxx1z-decomposition.cpp [c++17] P0490R0, NB comment FI 20: allow direct-initialization of decomposition declarations. 2016-12-09 22:56:20 +00:00
cxx1z-fold-expressions.cpp PR24440: Do not silently discard a fold-expression appearing as the operand of a cast-expression. 2017-02-15 19:57:10 +00:00
cxx1z-init-statement.cpp P0305R0: Semantic analysis and code generation for C++17 init-statement for 'if' and 'switch': 2016-07-14 00:11:03 +00:00
cxx1z-nested-namespace-definition.cpp Replace remaining user-visible mentions of C++1z with C++17. 2017-08-13 22:26:53 +00:00
cxx1z-using-declaration.cpp [c++1z] P0195R2: Support pack-expansion of using-declarations. 2016-12-20 21:35:28 +00:00
cxx2a-bitfield-init.cpp [c++2a] P0683R1: Permit default member initializers for bit-fields. 2017-08-28 00:28:14 +00:00
cxx11-base-spec-attributes.cpp
cxx11-brace-initializers.cpp
cxx11-stmt-attributes.cpp Add #pragma clang fp 2017-04-04 21:18:36 +00:00
cxx11-templates.cpp Reject varargs '...' in function prototype if there are more parameters after 2014-08-11 23:30:23 +00:00
cxx11-type-specifier.cpp Replace "can not" with "cannot" in diagnostics messages. 2014-03-07 22:36:23 +00:00
cxx11-user-defined-literals.cpp When pretty-printing a C++11 literal operator, don't insert whitespace between 2015-10-08 00:17:59 +00:00
debugger-import-module.m Added a testcase to make sure the parser allows 2014-12-10 18:57:09 +00:00
declarators.c revert patch r216469. 2014-08-26 21:10:47 +00:00
declspec-recovery.c Improve diagnostic reporting when using __declspec without enabling __declspec as a keyword. 2017-02-14 22:47:20 +00:00
declspec-supported.c Improve diagnostic reporting when using __declspec without enabling __declspec as a keyword. 2017-02-14 22:47:20 +00:00
designator.c
diag-crash.c Fix crash when both ExpectAndConsume and ConsumeAnyToken emit diagnostics 2014-02-23 03:45:03 +00:00
editor-placeholder-recovery.cpp Add support for editor placeholders to Clang 2017-04-19 08:58:56 +00:00
empty-translation-unit.c
encode.m
enhanced-proto-1.m
eof.cpp Diagnose attempts to explicitly instantiate a template at class scope. Previously Clang would simply ignore the 'template' keyword in this case. 2017-02-09 22:14:25 +00:00
eof2.cpp Parse: Don't crash on trailing whitespace before EOF 2014-07-26 05:41:31 +00:00
expressions.c Continue parsing an expression list even after an error is encountered. 2014-07-14 22:48:10 +00:00
expressions.m
extension.c
extra-semi.cpp P0305R1: Parsing support for init-statements in 'if' and 'switch' statements. 2016-06-29 21:17:59 +00:00
for.cpp
function-decls.c
gcc-__final-compatibility.cpp [GCC] Support for __final specifier 2016-07-29 10:42:48 +00:00
goto.c
if-scope-c90.c
if-scope-c99.c
implicit-casts.c
knr_parameter_attributes.c
lambda-attr.cu [CUDA] Emit deferred diagnostics during Sema rather than during codegen. 2016-10-13 20:52:12 +00:00
method-def-in-class.m
method-prototype-1.m
missing-closing-rbrace.m
missing-end-2.m
missing-end-3.m
missing-end-4.m Revert my patch in r191155 to allow forward 2013-09-24 17:03:07 +00:00
missing-end.m
missing-selector-name.mm
ms-anachronism.c clang-cl: support __cdecl-on-struct anachronism 2016-03-21 16:08:49 +00:00
ms-if-exists.c Fix crash when using __if_exists in C mode 2014-11-24 17:29:35 +00:00
ms-if-exists.cpp Fix parsing nested __if_exists blocks 2014-06-25 00:28:35 +00:00
ms-inline-asm-nested-braces.c Add support for nested blocks in Microsoft inline assembly 2014-07-06 05:26:54 +00:00
ms-inline-asm.c (clang part) Implement MASM-flavor intel syntax behavior for inline MS asm block. 2016-09-02 23:16:06 +00:00
ms-seh.c Don't crash on missing '{' after __except or __finally, PR22687. 2015-02-25 02:22:06 +00:00
ms-square-bracket-attributes.mm Warn that the [] spelling of uuid(...) is deprecated. 2017-05-05 17:05:56 +00:00
namelookup-bug-1.c
namelookup-bug-2.c
namespace-alias-attr.cpp Parse: __attribute__((keyword)) shouldn't error 2015-01-03 19:41:00 +00:00
namespaces.cpp Parse: Don't crash when namespace is in GNU statement expr 2015-01-09 09:38:14 +00:00
no-gnu-inline-asm.c Allow empty assembly string literal with -fno-gnu-inline-asm 2015-05-12 00:16:37 +00:00
nullability.c Accept nullability qualifiers on array parameters. 2016-11-10 23:28:17 +00:00
objc-alias-printing.m
objc-at-directive-fixit.m [ObjC] Avoid a @try/@finally/@autoreleasepool fixit when parsing an expression 2016-12-01 12:14:38 +00:00
objc-at-implementation-eof-crash.m Add a missing '[' to the tests from r305719 2017-06-20 16:16:11 +00:00
objc-at-interface-eof-crash.m Add a missing '[' to the tests from r305719 2017-06-20 16:16:11 +00:00
objc-available.m Warn about uses of `@available` that can't suppress the 2017-05-24 15:15:29 +00:00
objc-boxing.m
objc-category-neg-1.m
objc-class-property.m ObjC class properties: add diagnostics for unimplemented class properties. 2016-04-12 23:01:55 +00:00
objc-cxx-keyword-identifiers.mm [Parser][ObjC++] Improve diagnostics and recovery when C++ keywords are used 2017-04-11 15:01:53 +00:00
objc-default-ctor-init.mm Add a test case to check a member's default constructor is also run. 2016-04-19 02:21:47 +00:00
objc-diag-width.mm Add 'not' to commands that are expected to fail. 2013-07-04 16:16:58 +00:00
objc-error-qualified-implementation.m Parsing, semantic analysis, and AST for Objective-C type parameters. 2015-07-07 03:57:15 +00:00
objc-forcollection-1.m
objc-forcollection-neg-2.m
objc-forcollection-neg.m
objc-foreach-syntax.m
objc-init.m [Lit Test] Updated 20 Lit tests to be C++11 compatible. 2015-12-10 01:07:17 +00:00
objc-interfaces.m
objc-messaging-1.m
objc-messaging-neg-1.m
objc-missing-impl.m
objc-property-syntax.m Fix the spelling of 'bitfield' in diagnostics to be consistently 'bit-field'. 2016-12-20 02:43:58 +00:00
objc-quirks.m
objc-recover.mm
objc-synthesized-recover.m
objc-try-catch-1.m
objc-type-printing.m
objcbridge-related-attribute.m ObjectiveC - Introducing objc_bridge_related attribute 2013-12-04 20:32:50 +00:00
objcxx-at.mm
objcxx-lambda-expressions-neg.mm [Lit Test] Updated 20 Lit tests to be C++11 compatible. 2015-12-10 01:07:17 +00:00
objcxx0x-lambda-expressions.mm N3922: direct-list-initialization of an auto-typed variable no longer deduces a 2015-11-11 01:36:17 +00:00
objcxx11-attributes.mm Adding the Subjects entry back for the noreturn attributes. This caused some test cases to be updated because the original diagnostic was about applying to methods as well as functions, but the semantic checking disallowed methods. 2013-11-27 18:53:58 +00:00
objcxx11-initialized-temps.mm
objcxx11-messaging-and-lambda.mm [Parser] Fix look ahead after EOF while parsing objc message and lambdas 2016-05-31 18:46:31 +00:00
objcxx11-protocol-in-template.mm [Parser] Update CachedTokens while parsing ObjectiveC template argument list 2016-01-31 00:47:51 +00:00
objcxx11-user-defined-literal.mm
objcxx14-protocol-in-template.mm [Parser] Perform CachedTokens update dependent on token consumption 2016-02-05 19:36:39 +00:00
offsetof.c
opencl-astype.cl [OpenCL] Add supported OpenCL extensions to target info. 2016-05-16 17:06:34 +00:00
opencl-atomics-cl20.cl [OpenCL] Extended diagnostics for atomic initialization 2017-04-05 12:47:10 +00:00
opencl-cl20.cl [OpenCL] Output OpenCL version in diagnostics. 2016-05-12 16:28:25 +00:00
opencl-image-access.cl [OpenCL] Refine OpenCLImageAccessAttr to OpenCLAccessAttr 2016-02-26 03:13:03 +00:00
opencl-kernel.cl
opencl-keywords.cl Fix a typo in r204164 that made *all* keywords available in OpenCL mode. 2014-03-18 22:43:19 +00:00
opencl-pragma.cl Recommit r289979 [OpenCL] Allow disabling types and declarations associated with extensions 2016-12-18 05:18:55 +00:00
opencl-storage-class.cl [OpenCL] Add supported OpenCL extensions to target info. 2016-05-16 17:06:34 +00:00
opencl-unroll-hint.cl [OpenCL] Generate metadata for opencl_unroll_hint attribute 2016-02-19 18:30:11 +00:00
parenthesis-balance.cpp
parmvardecl_conversion.c
parser_overflow.c Add 'not' to commands that are expected to fail. 2013-07-04 16:16:58 +00:00
placeholder-recovery.m Add support for editor placeholders to Clang 2017-04-19 08:58:56 +00:00
pointer-arithmetic.c
pointer_promotion.c
pragma-attribute-declspec.cpp Add #pragma clang attribute 2017-04-18 14:33:39 +00:00
pragma-attribute.cpp Add #pragma clang attribute support to the availability attribute 2017-04-20 09:35:02 +00:00
pragma-fp-contract.c Fix bogus diagnostic wording. There's no such thing as a compound expression. 2013-11-15 21:08:45 +00:00
pragma-fp.cpp Add #pragma clang fp 2017-04-04 21:18:36 +00:00
pragma-loop-safety.cpp Add loop pragma for Loop Distribution 2016-06-14 12:04:26 +00:00
pragma-loop.cpp Add loop pragma for Loop Distribution 2016-06-14 12:04:26 +00:00
pragma-optimize-diagnostics.cpp Implemented support for "pragma clang optimize on/off", based on attribute 'optnone'. 2014-05-23 12:13:25 +00:00
pragma-options.c Recommit r308327 3rd time: Add a warning for missing 2017-07-28 14:41:21 +00:00
pragma-options.cpp Recommit r308327 3rd time: Add a warning for missing 2017-07-28 14:41:21 +00:00
pragma-pack.c Recommit r308327 3rd time: Add a warning for missing 2017-07-28 14:41:21 +00:00
pragma-unroll.cpp Add new llvm.loop.unroll.enable metadata for use with "#pragma unroll". 2015-08-10 17:29:39 +00:00
pragma-visibility.c
pragma-visibility2.c
pragma-weak.c Fix a parser crash when there are #pragmas in a context which requires a single 2013-10-28 22:04:30 +00:00
promote_types_in_proto.c
recovery.c
recovery.cpp Revert "Improve declaration / expression disambiguation around ptr-operators, and use" 2015-02-23 22:36:28 +00:00
recovery.m
recursion-limits.cpp
selector-1.m
skip-function-bodies.mm Expose cxx constructor and method properties through libclang and python bindings. 2016-04-27 12:48:25 +00:00
statements.c
struct-recursion.c
switch-recovery.cpp Sema: Don't leave switch stack inconsistent when recovering 2014-12-15 07:46:12 +00:00
top-level-semi-cxx0x.cpp
traditional_arg_scope.c
typeof.c
types.c
vector-cast-define.cl Reapplied r298976 [OpenCL] Added parsing for OpenCL vector types. 2017-03-29 12:09:39 +00:00
vsx.c Remove the -faltivec alias option and replace it with -maltivec everywhere. 2017-03-21 22:06:18 +00:00
warn-cuda-compat.cu Add support for '#pragma unroll'. 2014-07-21 18:08:34 +00:00
warn-dangling-else.cpp
warn-semicolon-before-method-body.m Fix a tranche of comment, test and doc typos 2013-12-05 16:25:25 +00:00
x64-windows-calling-convention-handling.c Windows ARM: ignore calling conventions as described on MSDN 2015-08-14 18:00:09 +00:00