hanchenye-llvm-project/clang/test/SemaObjC
Bruno Cardoso Lopes 218c8743c8 [SemaObjC] Be more strict while parsing type arguments and protocols
Fix a crash-on-invalid.

When parsing type arguments and protocols,
parseObjCTypeArgsOrProtocolQualifiers() calls ParseTypeName(), which tries to
find matching tokens for '[', '(', etc whenever they appear among potential
type names. If unmatched, ParseTypeName() yields a tok::eof token stream. This
leads to crashes since the parsing at this point is not expected to go beyond
the param list closing '>'.

Fix that by properly handling tok::eof in
parseObjCTypeArgsOrProtocolQualifiers() callers.

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

rdar://problem/25063557

llvm-svn: 281383
2016-09-13 20:04:35 +00:00
..
Inputs Add TreatUnavailableAsInvalid for the verification-only mode in InitListChecker. 2016-03-10 18:53:19 +00:00
ClassPropertyNotObject.m
ContClassPropertyLookup.m
DoubleMethod.m
NSString-type.m
access-property-getter.m [SemaObjC] Remove unused code from test. 2015-08-21 20:28:16 +00:00
alias-test-1.m
alias-test-2.m
arc-bridged-cast.m [Objective-C Sema] It is permissable to bridge cast to 'id' 2015-04-09 23:39:53 +00:00
arc-cf.m
arc-decls.m
arc-dict-bridged-cast.m Allow (Object *)kMyGlobalCFObj casts without bridging 2015-02-25 20:09:06 +00:00
arc-invalid.m
arc-jump-block.m
arc-no-runtime.m Be more conservative about diagnosing "incorrect" uses of __weak: 2015-10-27 04:54:50 +00:00
arc-non-pod-memaccess.m
arc-nsconsumed-errors.m
arc-objc-lifetime-conflict.m ObjC lifetime: pull sugar off when the qualifiers conflict. 2016-06-01 17:14:19 +00:00
arc-objc-lifetime.m
arc-objcbridge-related-attribute.m
arc-peformselector.m
arc-property-decl-attrs.m ObjC properties: consider ownership of properties from protocols when synthesizing. 2015-12-18 00:52:31 +00:00
arc-property-lifetime.m Some minor ARC diagnostic improvements. 2015-10-21 18:06:38 +00:00
arc-property.m
arc-readonly-property-ivar-1.m
arc-readonly-property-ivar.m
arc-repeated-weak.mm [Objective-c] Do not set IsExact to true when the receiver is a class. 2016-03-22 05:00:21 +00:00
arc-setter-property-match.m
arc-system-header.m Add TreatUnavailableAsInvalid for the verification-only mode in InitListChecker. 2016-03-10 18:53:19 +00:00
arc-type-conversion.m
arc-unavailable-for-weakref.m Fix inference of _Nullable for weak Objective-C properties. 2015-10-09 20:36:17 +00:00
arc-unavailable-system-function.m Refine r251469 to give better (and more localizable) diagnostics 2015-10-28 05:03:19 +00:00
arc-unbridged-cast.m Allow (Object *)kMyGlobalCFObj casts without bridging 2015-02-25 20:09:06 +00:00
arc-unsafe-assigns.m
arc-unsafe_unretained.m
arc.m Some minor ARC diagnostic improvements. 2015-10-21 18:06:38 +00:00
argument-checking.m
assign-rvalue-message.m
at-defs.m
atomoic-property-synnthesis-rules.m Adding back in a test that I inadvertently removed in r258862 2016-01-27 15:51:56 +00:00
attr-availability-1.m AvailabilityAttr: we accept "macos" as the platform name. 2016-06-28 20:55:30 +00:00
attr-availability.m [ObjC] Warn on unguarded use of partial declaration 2016-08-16 17:44:11 +00:00
attr-cf_returns.m Allow the cf_returns_[not_]retained attributes to appear on out-parameters. 2015-06-19 23:17:46 +00:00
attr-cleanup.m
attr-deprecated-pch.m
attr-deprecated.m AvailabilityAttr: we accept "macos" as the platform name. 2016-06-28 20:55:30 +00:00
attr-designated-init.m [sema] Allow to opt-out of overriding the super class's designated initializers by marking the initializer as unavailable in the subclass. 2015-07-30 19:06:04 +00:00
attr-malloc.m Sema: Add support for __declspec(restrict) 2015-02-04 07:23:21 +00:00
attr-nodebug.m Add a Subjects line to NoDebugAttr [NFC]. 2016-04-29 17:03:34 +00:00
attr-objc-exception.m
attr-objc-gc.m Define weak and __weak to mean ARC-style weak references, even in MRC. 2015-10-22 18:38:17 +00:00
attr-objc-runtime-visible.m [Objective-C] Introduce objc_runtime_visible attribute. 2016-04-01 23:23:52 +00:00
attr-print.m
attr-root-class.m
autoreleasepool.m
bad-property-synthesis-crash.m
bad-receiver-1.m
block-as-object.m
block-attr.m
block-explicit-return-type.m
block-id-as-block-argtype.m
block-ivar.m
block-omitted-return-type.m Block: Fix a crash when we have type attributes or qualifiers with omitted 2016-04-18 18:40:51 +00:00
block-on-method-param.m
block-return.m
block-type-safety.m Improve the Objective-C common-type computation used by the ternary operator. 2015-07-07 03:58:01 +00:00
blocks.m Update a few more tests in response to the MS ABI enum semantics 2015-10-08 08:28:09 +00:00
bool-type.m ARMv7k: implement ABI changes for watchOS from standard iOS. 2015-10-30 16:30:45 +00:00
boxing-illegal.m
builtin_objc_assign_ivar.m
builtin_objc_lib_functions.m
builtin_objc_msgSend.m
builtin_objc_nslog.m
call-super-2.m [SemaObjC] Do not RebuildObjCMessageExpr without valid method decl 2016-08-22 21:50:22 +00:00
catch-stmt.m
category-1.m
category-method-lookup-2.m
category-method-lookup.m
check-dup-decl-methods-1.m
check-dup-objc-decls-1.m
check-objcbridge-related-attribute-lookup.m
circular-container.m [ObjC] Circular containers: add support of subclasses 2015-08-06 04:51:14 +00:00
class-bitfield.m C11 _Bool bitfield diagnostic 2015-09-14 21:27:36 +00:00
class-conforming-protocol-1.m
class-conforming-protocol-2.m
class-def-test-1.m
class-extension-after-implementation.m
class-extension-dup-methods.m [Sema/objc] When checking for unimplemented methods treat methods from class extensions as continuation of the class interface. 2015-10-13 23:27:34 +00:00
class-getter-using-dotsyntax.m
class-impl-1.m
class-message-protocol-lookup.m
class-method-lookup.m
class-method-self.m
class-property-access.m
class-proto-1.m
class-protocol-method-match.m
class-protocol.m
class-unavail-warning.m [Sema] Check availability of ObjC super class and protocols of a container 2015-04-19 20:15:55 +00:00
cocoa-api-usage.m
cocoa-api-usage.m.fixed
compare-qualified-class.m
compare-qualified-id.m
compatible-protocol-qualified-types.m
compound-init.m
comptypes-1.m
comptypes-2.m
comptypes-3.m
comptypes-4.m
comptypes-5.m
comptypes-6.m
comptypes-7.m
comptypes-8.m
comptypes-9.m Update mailing list references to lists.llvm.org 2015-08-05 03:55:23 +00:00
comptypes-10.m
comptypes-a.m
comptypes-legal.m
conditional-expr-2.m
conditional-expr-3.m
conditional-expr-4.m
conditional-expr-5.m
conditional-expr-6.m
conditional-expr-7.m
conditional-expr-8.m Improve the Objective-C common-type computation used by the ternary operator. 2015-07-07 03:58:01 +00:00
conditional-expr.m Improve the Objective-C common-type computation used by the ternary operator. 2015-07-07 03:58:01 +00:00
conflict-atomic-property.m
conflict-nonfragile-abi2.m
conflicting-ivar-test-1.m
continuation-class-err.m
continuation-class-property.m
conversion.m
crash-label.m
crash-on-objc-bool-literal.m
crash-on-type-args-protocols.m [SemaObjC] Be more strict while parsing type arguments and protocols 2016-09-13 20:04:35 +00:00
custom-atomic-property.m
dealloc.m
debugger-cast-result-to-id.m
debugger-support.m Update Clang tests to handle explicitly typed load changes in LLVM. 2015-02-27 21:19:58 +00:00
default-synthesize-1.m [MSVC Compat] Try to treat an implicit, fixed enum as an unfixed enum 2015-10-08 10:04:46 +00:00
default-synthesize-2.m
default-synthesize-3.m
default-synthesize.m
delay-parsing-cfunctions.m
deprecate_function_containers.m
deprecated-objc-introspection.m
deref-interface.m
direct-synthesized-ivar-access.m
dist-object-modifiers.m
dllexport.m Sema: support __declspec(dll*) on ObjC interfaces 2016-07-15 20:41:10 +00:00
dllimport.m Sema: support __declspec(dll*) on ObjC interfaces 2016-07-15 20:41:10 +00:00
duplicate-ivar-check.m
duplicate-ivar-in-class-extension.m
duplicate-property-class-extension.m
duplicate-property.m
encode-typeof-test.m
enhanced-proto-2.m
enum-fixed-type.m ObjC: Handle boolean fixed type for enum. 2016-03-23 16:28:28 +00:00
err-ivar-access-in-class-method.m
error-implicit-property.m
error-missing-getter.m
error-outof-scope-property-use.m
error-property-gc-attr.m
exprs.m
foreach.m
format-arg-attribute.m Improving the diagnostic for cases where the attribute only appertains to a function with a prototype. 2015-11-04 16:09:04 +00:00
format-cstrings-warning.m
format-ostrace-warning.m [Objective-C]. Provide a new formatting kind, "os_trace" which 2015-02-21 00:45:58 +00:00
format-strings-objc.m [Sema] Attempt to fix tests for utf-8 invalid format string specifiers 2016-03-29 18:38:44 +00:00
format-strings-system.h
format-strings-utf8.m [Sema] Attempt [3] to fix tests for utf-8 invalid format string specifiers 2016-03-29 21:30:58 +00:00
forward-class-1.m
forward-class-receiver.m
forward-class-redeclare.m
forward-protocol-incomplete-impl-warn.m
gc-attributes.m Define __unsafe_unretained and __autoreleasing in ObjC GC mode. 2015-11-10 23:00:25 +00:00
gcc-cast-ext.m
generic-selection.m
getter-setter-defined-in-category-of-parent.m
ibaction.m
iboutlet.m arc-repeated-use-of-weak should not warn about IBOutlet properties 2016-05-25 05:41:57 +00:00
iboutletcollection-attr.m
id.m
id_builtin.m
idiomatic-parentheses.m
ignore-qualifier-on-qualified-id.m
ignore-weakimport-method.m
illegal-nonarc-bridged-cast.m
incompatible-protocol-qualified-types.m
incomplete-implementation.m
inst-method-lookup-in-root.m
instancetype.m
interface-1.m Handle Objective-C type arguments. 2015-07-07 03:57:35 +00:00
interface-layout-2.m
interface-layout.m
interface-scope-2.m
interface-scope.m
interface-tu-variable.m
invalid-code.m
invalid-objc-decls-1.m
invalid-receiver.m
invalid-typename.m
ivar-access-package.m
ivar-access-tests.m
ivar-in-class-extension-error.m
ivar-in-class-extension.m
ivar-in-implementations.m
ivar-lookup-resolution-builtin.m
ivar-lookup.m
ivar-ref-misuse.m
ivar-sem-check-1.m
ivar-sem-check-2.m
kindof.m ObjectiveC Generics: Start using ObjCTypeParamType. 2016-09-13 17:41:05 +00:00
legacy-implementation-1.m
message.m
method-arg-qualifier-warning.m
method-attributes.m
method-bad-param.m
method-conflict-1.m
method-conflict-2.m
method-conflict.m
method-def-1.m
method-def-2.m
method-encoding-2.m
method-in-class-extension-impl.m
method-lookup-2.m
method-lookup-3.m
method-lookup-4.m
method-lookup-5.m
method-lookup.m
method-no-context.m
method-not-defined.m
method-prototype-scope.m
method-sentinel-attr.m
method-typecheck-1.m
method-typecheck-2.m
method-typecheck-3.m
method-undef-category-warn-1.m
method-undef-extension-warn-1.m
method-undefined-warn-1.m
method-unused-attribute.m
method-warn-unused-attribute.m Implement support for [[nodiscard]] in C++1z that is based off existing support for warn_unused_result, and treat it as an extension pre-C++1z. This also means extending the existing warn_unused_result attribute so that it can be placed on an enum as well as a class. 2016-03-07 22:44:55 +00:00
mismatched-undefined-method.m
missing-atend-metadata.m
missing-method-context.m
missing-method-return-type.m
mrc-no-weak.m Refine r251469 to give better (and more localizable) diagnostics 2015-10-28 05:03:19 +00:00
mrc-weak.m Don't actually add the __unsafe_unretained qualifier in MRC; 2015-11-19 02:28:03 +00:00
multiple-method-names.m ObjC kindof: order the methods in global pool relative to availability. 2016-04-13 23:43:56 +00:00
multiple-property-deprecated-decl.m [Objective-C Sema] Patch to not issue unavailbility/deprecated 2015-04-07 16:56:27 +00:00
narrow-property-type-in-cont-class.m
nested-typedef-decl.m
newproperty-class-method-1.m
no-gc-weak-test.m Be more conservative about diagnosing "incorrect" uses of __weak: 2015-10-27 04:54:50 +00:00
no-ivar-access-control.m
no-ivar-in-interface-block.m
no-objc-exceptions.m
no-protocol-option-tests.m
no-warn-qual-mismatch.m
no-warn-synth-protocol-meth.m
no-warn-unimpl-method.m
no-warning-unavail-unimp.m
nonnull.h
nonnull.m [Sema] Don't crash when __attribute__((nonnull)) is applied to blocks 2015-04-07 06:01:53 +00:00
nowarn-superclass-method-mismatch.m
ns_returns_retained_block_return.m
nsobject-attribute-1.m
nsobject-attribute.m Objective-C diagnostics: isObjCNSObjectType should check through AttributedType. 2016-08-15 21:05:00 +00:00
nullability-arc.m Replace __double_underscored type nullability qualifiers with _Uppercase_underscored 2015-06-24 22:02:08 +00:00
nullability.m [Sema][ObjC] Compute the nullability of a conditional expression based 2016-07-25 21:58:19 +00:00
nullable-weak-property.m Fix inference of _Nullable for weak Objective-C properties. 2015-10-09 20:36:17 +00:00
objc-array-literal.m [SemaObjC] Improve ObjCDictionaryLiteral and ObjCArryLiteral diagnostics 2016-07-19 20:21:18 +00:00
objc-asm-attribute-neg-test.m
objc-boxed-expressions-nsvalue.m Cleanup ObjCInterfaceDecl lookup for ObjC literals 2015-07-24 05:09:40 +00:00
objc-buffered-methods.m
objc-cf-audited-warning.m
objc-class-property.m ObjC Class Property: diagnostics when accessing a class property using instance. 2016-06-28 23:01:49 +00:00
objc-container-subscripting-1.m
objc-container-subscripting-2.m
objc-container-subscripting-3.m
objc-container-subscripting-attr.m
objc-container-subscripting.m
objc-cstyle-args-in-methods.m
objc-dictionary-literal.m [SemaObjC] Improve ObjCDictionaryLiteral and ObjCArryLiteral diagnostics 2016-07-19 20:21:18 +00:00
objc-independent-class-attribute.m [Objective-C Sema]. In my last patch change the 2015-04-16 21:52:34 +00:00
objc-literal-comparison.m
objc-literal-nsnumber.m Cleanup ObjCInterfaceDecl lookup for ObjC literals 2015-07-24 05:09:40 +00:00
objc-literal-sig.m
objc-mixed-bridge-attribute.m
objc-qualified-property-lookup.m
objc-string-constant.m
objc2-merge-gc-attribue-decl.m [Sema] Emit a better diagnostic when variable redeclarations disagree 2015-07-14 20:08:49 +00:00
objc2-warn-weak-decl.m
objcbridge-attribute-arc.m Set the default C standard to C99 when targeting the PS4. 2016-04-27 19:53:03 +00:00
objcbridge-attribute.m [Objective-C Sema] Fixes a typo which did not allow 2015-04-10 22:07:47 +00:00
objcbridge-related-attribute.m
objcbridgemutable-attribute.m [Objective-C Sema] Fixes a typo which did not allow 2015-04-10 22:07:47 +00:00
opaque-is-access-warn.m Support watchOS and tvOS driver options 2015-10-30 16:30:27 +00:00
opaque-is-access.m
override-nullability.m Extend type nullability qualifiers for Objective-C. 2015-06-19 18:14:38 +00:00
overriding-property-in-class-extension.m
ovl-check.m [Sema] More changes to fix Objective-C fallout from r249995. 2016-02-13 01:41:41 +00:00
parameterized_classes.m [SemaObjC] Properly handle mix between type arguments and protocols. 2016-04-13 20:59:07 +00:00
parameterized_classes_arc.m Forbid qualifiers on ObjC generic parameters and arguments, but 2015-09-23 22:14:21 +00:00
parameterized_classes_collection_literal.m Warn when an Objective-C collection literal element is converted to an incompatible type. 2015-07-07 03:58:22 +00:00
parameterized_classes_subst.m ObjectiveC Generics: Start using ObjCTypeParamType. 2016-09-13 17:41:05 +00:00
pedantic-dynamic-test.m
pragma-pack.m
property-2.m
property-3.m Objective-C properties: merge attributes when redeclaring 'readonly' as 'readwrite' in an extension. 2015-12-10 23:02:09 +00:00
property-4.m
property-5.m
property-6.m
property-7.m
property-8.m
property-9-impl-method.m
property-9.m [Objective-C Sema] Use canonical type of properties when comparing 2015-04-08 21:34:04 +00:00
property-10.m
property-11.m
property-12.m
property-13.m
property-ambiguous-synthesis.m
property-and-class-extension.m
property-and-ivar-use.m
property-atomic-bool.m Don't feed standard error to FileCheck. 2016-05-26 02:32:10 +00:00
property-atomic-redecl.m Objective-C properties: merge attributes when redeclaring 'readonly' as 'readwrite' in an extension. 2015-12-10 23:02:09 +00:00
property-category-1.m
property-category-2.m
property-category-3.m
property-category-4.m
property-category-impl.m
property-choose-expr.m
property-deprecated-warning.m [ObjC] Warn on unguarded use of partial declaration 2016-08-16 17:44:11 +00:00
property-dot-receiver.m
property-error-readonly-assign.m
property-expression-error.m
property-impl-misuse.m
property-in-class-extension-1.m Objective-C properties: loosen 'atomic' checking for readonly properties. 2015-12-09 22:57:32 +00:00
property-in-class-extension.m [Sema/objc] When checking for unimplemented methods treat methods from class extensions as continuation of the class interface. 2015-10-13 23:27:34 +00:00
property-inherited.m
property-ivar-mismatch.m
property-lookup-in-id.m
property-method-lookup-impl.m
property-missing.m
property-nonfragile-abi.m
property-noninherited-availability-attr.m AvailabilityAttr: we accept "macos" as the platform name. 2016-06-28 20:55:30 +00:00
property-noprotocol-warning.m
property-not-lvalue.m
property-ns-returns-not-retained-attr.m
property-ownership-attr.m
property-redundant-decl-accessor.m
property-typecheck-1.m
property-user-setter.m
property-weak.m
property.m
props-on-prots.m
protocol-archane.m C++ support for Objective-C lightweight generics. 2015-07-07 03:58:14 +00:00
protocol-attribute.m
protocol-expr-1.m
protocol-expr-neg-1.m
protocol-id-test-1.m
protocol-id-test-2.m
protocol-id-test-3.m
protocol-implementation-inherited.m
protocol-implementing-class-methods.m
protocol-lookup-2.m
protocol-lookup.m
protocol-qualified-class-unsupported.m
protocol-typecheck.m
protocol-warn.m Improve the Objective-C common-type computation used by the ternary operator. 2015-07-07 03:58:01 +00:00
protocols-suppress-conformance.m
protocols.m
provisional-ivar-lookup.m
qualified-protocol-method-conflicts.m
rdar6248119.m
rdr-6211479-array-property.m
receiver-forward-class.m
related-result-type-inference.m
resolve-method-in-global-pool.m
restrict-id-type.m
return.m
scope-check.m
selector-1.m
selector-2.m
selector-3.m [Objective-C Sema]. Don't warn about use of 2015-02-19 21:52:41 +00:00
selector-4.m
selector-error.m
selector-overload.m
self-assign.m
self-comparison.m
self-declared-in-block.m
self-in-function.m
setter-dotsyntax.m
severe-syntax-error.m
sign-conversion.m
sizeof-interface.m
special-dep-unavail-warning.m
stand-alone-implementation.m
static-ivar-ref-1.m
stmts.m
string.m
super-cat-prot.m
super-class-protocol-conformance.m
super-dealloc-attribute.m
super-property-message-expr.m
super-property-notation.m
super.m
synchronized.m
synth-provisional-ivars-1.m
synth-provisional-ivars.m
synthesize-setter-contclass.m
synthesized-ivar.m Be more conservative about diagnosing "incorrect" uses of __weak: 2015-10-27 04:54:50 +00:00
tentative-property-decl.m
transparent-union.m
try-catch.m
typedef-class.m
typo-correction-arc.m Sema: handle typo correction on ARC'ed ivar 2016-02-07 02:30:59 +00:00
typo-correction.m [sema] Fix crash when typo-transforming an expression containing an ObjC super message expression. 2015-07-28 06:12:24 +00:00
ucn-objc-string.m
undeclared-selector.m
undef-arg-super-method-call.m [Objective-C patch]. Amend TransformObjCMessageExpr to handle call 2015-03-30 23:30:24 +00:00
undef-class-messagin-error.m
undef-protocol-methods-1.m
undef-superclass-1.m
undefined-protocol-type-1.m
unguarded-availability.m [ObjC] Warn on unguarded use of partial declaration 2016-08-16 17:44:11 +00:00
unimplemented-protocol-prop.m
uninit-variables.m
unknown-anytype.m
unqualified-to-qualified-class-warn.m
unused-backing-ivar-warning.m
unused.m [Objctive-C sema]. Do not do the unused-getter-return-value 2015-02-16 23:49:44 +00:00
va-method-1.m
warn-assign-property-nscopying.m
warn-cast-of-sel-expr.m
warn-category-method-deprecated.m
warn-deprecated-implementations.m
warn-direct-ivar-access.m
warn-explicit-call-initialize.m
warn-forward-class-attr-deprecated.m
warn-implicit-atomic-property.m
warn-implicit-self-in-block.m
warn-incompatible-builtin-types.m
warn-loop-analysis.m Fix false positives for for-loop-analysis warning 2016-03-10 02:02:48 +00:00
warn-missing-super.m
warn-protocol-method-deprecated.m
warn-retain-block-property.m
warn-retain-cycle.m
warn-selector-selection.m
warn-strict-selector-match.m ObjC kindof: check the context when inserting methods to global pool. 2016-04-09 18:59:48 +00:00
warn-superclass-method-mismatch.m
warn-thread-safety-analysis.m
warn-unreachable.m
warn-unused-exception-param.m
warn-weak-field.m
warn-write-strings.m
warning-missing-selector-name.m
weak-attr-ivar.m
weak-property.m
writable-property-in-superclass.m