hanchenye-llvm-project/clang/test/Parser
Volodymyr Sapsai 9f7b5cc073 [Parser] Fix assertion-on-invalid for unexpected typename.
In `ParseDeclarationSpecifiers` for the code

    class A typename A;

we were able to annotate token `kw_typename` because it refers to
existing type. But later during processing token `annot_typename` we
failed to `SetTypeSpecType` and exited switch statement leaving
annotation token unconsumed. The code after the switch statement failed
because it didn't expect a special token.

The fix is not to assume that switch statement consumes all special
tokens and consume any token, not just non-special.

rdar://problem/37099386

Reviewers: rsmith, arphaman

Reviewed By: rsmith

Subscribers: jkorous-apple, cfe-commits

Differential Revision: https://reviews.llvm.org/D44449

llvm-svn: 329735
2018-04-10 18:29:47 +00:00
..
CompoundStmtScope.c
DelayedTemplateParsing.cpp
MicrosoftExtensions.c
MicrosoftExtensions.cpp [MS] Accept __unaligned as a qualifier on member function pointers 2018-03-07 23:26:02 +00:00
MicrosoftExtensionsInlineAsm.c
PR11000.cpp
PR21872.cpp
access-spec-attrs.cpp
altivec-csk-bool.c
altivec.c
annotation-token-in-lexed-body.cpp
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
asm.cpp
atomic.c
attr-availability.c
attr-external-source-symbol-cxx11.cpp
attr-external-source-symbol.m
attributes.c
attributes.mm
backtrack-crash.cpp
backtrack-off-by-one.cpp
bad-control.c
block-block-storageclass.c
block-pointer-decl.c
bracket-crash.cpp
brackets.c Fix typos in clang 2018-04-06 15:14:32 +00:00
brackets.cpp Fix typos in clang 2018-04-06 15:14:32 +00:00
builtin_classify_type.c
builtin_types_compatible.c Make __builtin_types_compatible_p more like GCC's 2017-10-16 22:58:37 +00:00
c-namespace.c
c1x-alignas.c
c1x-generic-selection.c
c2x-attributes.c Add a fixit for attributes incorrectly placed prior to 'struct/class/enum' keyword. 2017-12-25 22:23:20 +00:00
c2x-attributes.m Add -f[no-]double-square-bracket-attributes as new driver options to control use of [[]] attributes in all language modes. This is the initial implementation of WG14 N2165, which is a proposal to add [[]] attributes to C2x, but also allows you to enable these attributes in C++98, or disable them in C++11 or later. 2017-10-15 15:01:42 +00:00
c11-noreturn.c
captured-statements.c
char-literal-printing.c
check-objc2-syntax-1.m
check-syntax-1.m
check_cast.c
colon-colon-parentheses.cpp
completely-empty-header-file.h
compound_literal.c
control-scope.c
crash-report.c
cuda-force-host-device-templates.cu
cuda-force-host-device.cu
cuda-kernel-call-c++11.cu
cuda-kernel-call.cu
cxx-altivec.cpp
cxx-ambig-decl-expr-xfail.cpp
cxx-ambig-decl-expr.cpp Add missing direct-init / parameter-declaration-clause disambiguation when 2018-02-02 22:24:54 +00:00
cxx-ambig-init-templ.cpp
cxx-ambig-paren-expr-asan.cpp
cxx-ambig-paren-expr.cpp
cxx-attributes.cpp
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
cxx-class-template-specialization.cpp
cxx-class.cpp
cxx-concept-declaration.cpp Remove old concepts parsing code 2017-12-07 00:34:20 +00:00
cxx-concepts-ambig-constraint-expr.cpp
cxx-concepts-requires-clause.cpp
cxx-condition.cpp
cxx-decl.cpp [Parser] Fix assertion-on-invalid for unexpected typename. 2018-04-10 18:29:47 +00:00
cxx-default-args.cpp
cxx-default-delete.cpp
cxx-ext-delete-default.cpp
cxx-extern-c-array.cpp
cxx-extra-semi.cpp [Parser] (C++) Make -Wextra-semi slightly more useful 2018-03-14 19:31:34 +00:00
cxx-friend.cpp
cxx-in-c.c
cxx-invalid-for-range.cpp
cxx-invalid-function-decl.cpp
cxx-member-crash.cpp
cxx-member-init-missing-paren-crash.cpp
cxx-member-initializers.cpp
cxx-modules-interface.cppm
cxx-namespace-alias.cpp
cxx-reference.cpp
cxx-stmt.cpp
cxx-template-argument.cpp
cxx-template-decl.cpp
cxx-throw.cpp
cxx-typeid.cpp
cxx-typeof.cpp
cxx-undeclared-identifier.cpp
cxx-using-declaration.cpp
cxx-using-directive.cpp
cxx-variadic-func.cpp
cxx0x-ambig.cpp
cxx0x-attributes.cpp Add a fixit for attributes incorrectly placed prior to 'struct/class/enum' keyword. 2017-12-25 22:23:20 +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 Add missing direct-init / parameter-declaration-clause disambiguation when 2018-02-02 22:24:54 +00:00
cxx0x-for-range.cpp
cxx0x-in-cxx98.cpp
cxx0x-lambda-expressions.cpp
cxx0x-literal-operators.cpp
cxx0x-member-initializers.cpp
cxx0x-override-control-keywords.cpp
cxx0x-rvalue-reference.cpp
cxx1z-attributes.cpp
cxx1z-class-template-argument-deduction.cpp [C++17] Fix class template argument deduction for default constructors without an initializer 2018-03-24 04:32:11 +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
cxx1z-decomposition.cpp Allow conditions to be decomposed with structured bindings 2017-12-07 07:03:15 +00:00
cxx1z-fold-expressions.cpp Fix usage of right shift operator in fold expressions 2017-10-31 20:29:22 +00:00
cxx1z-init-statement.cpp
cxx1z-nested-namespace-definition.cpp Switch to gnu++14 as the default dialect. 2017-12-09 12:09:54 +00:00
cxx1z-using-declaration.cpp
cxx2a-bitfield-init.cpp [c++2a] P0683R1: Permit default member initializers for bit-fields. 2017-08-28 00:28:14 +00:00
cxx2a-spaceship.cpp [c++20] P0515R3: Parsing support and basic AST construction for operator <=>. 2017-12-14 15:16:18 +00:00
cxx11-base-spec-attributes.cpp
cxx11-brace-initializers.cpp
cxx11-stmt-attributes.cpp
cxx11-templates.cpp
cxx11-type-specifier.cpp
cxx11-user-defined-literals.cpp
debugger-import-module.m
declarators.c
declspec-recovery.c
declspec-supported.c
decomposed-condition.cpp Fix codegen for structured binding binding in conditions 2018-03-17 21:01:27 +00:00
designator.c
diag-crash.c
editor-placeholder-recovery.cpp A '<' with a trigraph '#' is not a valid editor placeholder 2017-10-11 00:41:20 +00:00
empty-translation-unit.c
encode.m
enhanced-proto-1.m
eof.cpp
eof2.cpp
expressions.c
expressions.m
extension.c
extra-semi.cpp
for.cpp
function-decls.c
gcc-__final-compatibility.cpp
goto.c
if-scope-c90.c
if-scope-c99.c
implicit-casts.c
knr_parameter_attributes.c
lambda-attr.cu
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
missing-end.m
missing-selector-name.mm
ms-anachronism.c
ms-if-exists.c
ms-if-exists.cpp
ms-inline-asm-nested-braces.c
ms-inline-asm.c
ms-seh.c
ms-square-bracket-attributes.mm Determine the attribute subject for diagnostics based on declarative information in DeclNodes.td. This greatly reduces the number of enumerated values used for more complex diagnostics; these are now only required when the "attribute only applies to" diagnostic needs to be generated manually as part of semantic processing. 2017-11-26 20:01:12 +00:00
namelookup-bug-1.c
namelookup-bug-2.c
namespace-alias-attr.cpp
namespaces.cpp
no-gnu-inline-asm.c
nullability.c
objc-alias-printing.m
objc-at-directive-fixit.m
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-attr.m Allow the NS, CF, and ObjC attributes to be used with -fdouble-square-bracket-attributes. The syntactic locations for such attributes on ObjC constructs have been specifically chosen to follow the GNU attribute syntactic locations. 2018-02-12 13:38:25 +00:00
objc-available.m
objc-boxing.m
objc-category-neg-1.m
objc-class-property.m
objc-cxx-keyword-identifiers.mm
objc-default-ctor-init.mm Re-commit r321223, which adds a printing policy to the ASTDumper. 2017-12-21 21:42:42 +00:00
objc-diag-width.mm
objc-error-qualified-implementation.m
objc-forcollection-1.m
objc-forcollection-neg-2.m
objc-forcollection-neg.m
objc-foreach-syntax.m
objc-init.m
objc-interfaces.m
objc-messaging-1.m
objc-messaging-neg-1.m
objc-missing-impl.m
objc-property-syntax.m
objc-quirks.m
objc-recover.mm
objc-synthesized-recover.m
objc-try-catch-1.m
objc-type-printing.m
objcbridge-related-attribute.m
objcxx-at.mm
objcxx-lambda-expressions-neg.mm
objcxx0x-lambda-expressions.mm
objcxx11-attributes.mm
objcxx11-initialized-temps.mm
objcxx11-invalid-lambda.cpp [Parser] Fix TryParseLambdaIntroducer() error handling 2017-11-06 17:42:17 +00:00
objcxx11-messaging-and-lambda.mm
objcxx11-protocol-in-template.mm
objcxx11-user-defined-literal.mm
objcxx14-protocol-in-template.mm
offsetof.c
opencl-astype.cl
opencl-atomics-cl20.cl
opencl-cl20.cl
opencl-image-access.cl
opencl-kernel.cl
opencl-keywords.cl
opencl-pragma.cl
opencl-storage-class.cl
opencl-unroll-hint.cl
parenthesis-balance.cpp
parmvardecl_conversion.c
parser_overflow.c
placeholder-recovery.m
pointer-arithmetic.c
pointer_promotion.c Factor out comparison handling for arithmetic types. 2018-01-08 21:12:04 +00:00
pragma-attribute-declspec.cpp
pragma-attribute.cpp
pragma-fp-contract.c
pragma-fp.cpp
pragma-loop-safety.cpp
pragma-loop.cpp
pragma-optimize-diagnostics.cpp
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
pragma-visibility.c
pragma-visibility2.c
pragma-weak.c
promote_types_in_proto.c
recovery.c
recovery.cpp
recovery.m
recursion-limits.cpp
selector-1.m
skip-function-bodies.mm
statements.c
struct-recursion.c
switch-recovery.cpp
top-level-semi-cxx0x.cpp
traditional_arg_scope.c
typeof.c
types.c
vector-cast-define.cl
vsx.c
warn-cuda-compat.cu
warn-dangling-else.cpp
warn-semicolon-before-method-body.m
x64-windows-calling-convention-handling.c