hanchenye-llvm-project/clang/test/Parser
Jordan Rose 303e2f1eac Accept nullability qualifiers on array parameters.
Since array parameters decay to pointers, '_Nullable' and friends
should be available for use there as well. This is especially
important for parameters that are typedefs of arrays. The unsugared
syntax for this follows the syntax for 'static'-sized arrays in C:

  void test(int values[_Nullable]);

This syntax was previously accepted but the '_Nullable' (and any other
attributes) were silently discarded. However, applying '_Nullable' to
a typedef was previously rejected and is now accepted; therefore, it
may be necessary to test for the presence of this feature:

  #if __has_feature(nullability_on_arrays)

One important change here is that DecayedTypes don't always
immediately contain PointerTypes anymore; they may contain an
AttributedType instead. This only affected one place in-tree, so I
would guess it's not likely to cause problems elsewhere.

This commit does not change -Wnullability-completeness just yet. I
want to think about whether it's worth doing something special to
avoid breaking existing clients that compile with -Werror. It also
doesn't change '#pragma clang assume_nonnull' behavior, which
currently treats the following two declarations as equivalent:

  #pragma clang assume_nonnull begin
  void test(void *pointers[]);
  #pragma clang assume_nonnull end

  void test(void * _Nonnull pointers[]);

This is not the desired behavior, but changing it would break
backwards-compatibility. Most likely the best answer is going to be
adding a new warning.

Part of rdar://problem/25846421

llvm-svn: 286519
2016-11-10 23:28:17 +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 [ms] Add support for parsing uuid as a Microsoft attribute. 2016-09-03 03:25:22 +00:00
MicrosoftExtensionsInlineAsm.c
PR11000.cpp
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
altivec.c Add builtins for the 64-bit vector integer arithmetic instructions added in POWER8. 2015-03-11 15:57:19 +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 Windows ARM: ignore calling conventions as described on MSDN 2015-08-14 18:00:09 +00:00
asm-constraints-pr7869.c
asm.c
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
attributes.c
attributes.mm
backtrack-crash.cpp
backtrack-off-by-one.cpp Fix off-by-one error in PPCaching.cpp token annotation assertion 2016-10-20 20:53:20 +00:00
bad-control.c
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
builtin_types_compatible.c
c-namespace.c
c1x-alignas.c
c1x-generic-selection.c
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 Fix crash-on-invalid if a :: is followed by two or more open parentheses (and then something else). 2015-12-19 02:40:19 +00:00
completely-empty-header-file.h
compound_literal.c
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
cuda-kernel-call.cu
cxx-altivec.cpp The time when -faltivec (or, on clang only, -maltivec) will magically 2016-03-24 01:26:08 +00:00
cxx-ambig-decl-expr-xfail.cpp
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
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
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
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-import.cpp C++ Modules TS: add frontend support for building pcm files from module 2016-08-26 00:14:38 +00:00
cxx-modules-interface.cppm C++ Modules TS: Add parsing and some semantic analysis support for 2016-09-08 23:14:54 +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 [Lit Test] Updated 20 Lit tests to be C++11 compatible. 2015-12-10 01:07:17 +00:00
cxx-template-decl.cpp Diagnose function template definitions inside functions 2014-12-15 23:16:32 +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
cxx-using-directive.cpp
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 If a function decl cannot be merged, mark it as invalid. 2015-01-17 02:33:17 +00:00
cxx0x-attributes.cpp Silence duplicate diagnostics because parsing of a standards-based attribute triggers parsing diagnostics that may also be picked up during semantic analysis. 2016-03-08 21:31:32 +00:00
cxx0x-condition.cpp Re-commit r273548, reverted in r273589, with a fix to not produce 2016-06-23 19:02:52 +00:00
cxx0x-decl.cpp Fix rejects-valid when forming a pointer-to-member with 'decltype(expr)::*'. 2016-02-02 23:34:49 +00:00
cxx0x-for-range.cpp
cxx0x-in-cxx98.cpp
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
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
cxx1z-attributes.cpp Fix several accidental DOS line endings in source files 2016-01-03 15:55:40 +00:00
cxx1z-constexpr-lambdas.cpp [Cxx1z-constexpr-lambda-P0170R1] Support parsing of constexpr specifier (and its inference) on lambda expressions 2016-03-26 16:11:37 +00:00
cxx1z-coroutines.cpp [coroutines] Rename driver flag -fcoroutines to -fcoroutines-ts 2016-10-02 03:31:58 +00:00
cxx1z-decomposition.cpp P0217R3: Perform semantic checks and initialization for the bindings in a 2016-08-11 22:25:46 +00:00
cxx1z-fold-expressions.cpp PR26276: Fix detection of non-cast-expressions as operands of fold-expressions. 2016-10-20 00:55:15 +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
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 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
declarators.c
designator.c
diag-crash.c
empty-translation-unit.c
encode.m
enhanced-proto-1.m
eof.cpp
eof2.cpp
expressions.c
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
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
ms-if-exists.cpp
ms-inline-asm-nested-braces.c
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 Add a few more test for []-style uuid attributes. 2016-09-07 19:41:35 +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-available.m [ObjC] Warn on unguarded use of partial declaration 2016-08-16 17:44:11 +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-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
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
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 [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
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 Disable warning about core features by default 2016-06-01 18:04:53 +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
opencl-pragma.cl [OpenCL] Add supported OpenCL extensions to target info. 2016-05-16 17:06:34 +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
placeholder-recovery.m C++ support for Objective-C lightweight generics. 2015-07-07 03:58:14 +00:00
pointer-arithmetic.c
pointer_promotion.c
pragma-fp-contract.c
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
pragma-options.c
pragma-options.cpp
pragma-pack.c [Parser] Handle __pragma(pack, etc. after type definitions 2016-06-14 03:20:28 +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
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
vsx.c
warn-cuda-compat.cu
warn-dangling-else.cpp
warn-semicolon-before-method-body.m
x64-windows-calling-convention-handling.c Windows ARM: ignore calling conventions as described on MSDN 2015-08-14 18:00:09 +00:00