forked from OSchip/llvm-project
5030928d60
initializers. This has some interesting interactions with our existing extensions to support C99 designated initializers as an extension in C++. Those are resolved as follows: * We continue to permit the full breadth of C99 designated initializers in C++, with the exception that we disallow a partial overwrite of an initializer with a non-trivially-destructible type. (Full overwrite is OK, because we won't run the first initializer at all.) * The C99 extensions are disallowed in SFINAE contexts and during overload resolution, where they could change the meaning of valid programs. * C++20 disallows reordering of initializers. We only check for that for the simple cases that the C++20 rules permit (designators of the form '.field_name =' and continue to allow reordering in other cases). It would be nice to improve this behavior in future. * All C99 designated initializer extensions produce a warning by default in C++20 mode. People are going to learn the C++ rules based on what Clang diagnoses, so it's important we diagnose these properly by default. * In C++ <= 17, we apply the C++20 rules rather than the C99 rules, and so still diagnose C99 extensions as described above. We continue to accept designated C++20-compatible initializers in C++ <= 17 silently by default (but naturally still reject under -pedantic-errors). This is not a complete implementation of P0329R4. In particular, that paper introduces new non-C99-compatible syntax { .field { init } }, and we do not support that yet. This is based on a previous patch by Don Hinton, though I've made substantial changes when addressing the above interactions. Differential Revision: https://reviews.llvm.org/D59754 llvm-svn: 370544 |
||
---|---|---|
.. | ||
Inputs | ||
2007-10-03-MetadataPointers.mm | ||
2010-08-04-Template.mm | ||
2010-08-06-X.Y-syntax.mm | ||
address-safety-attr.mm | ||
arc-attrs-abi.mm | ||
arc-attrs.mm | ||
arc-blocks.mm | ||
arc-constexpr.mm | ||
arc-cxx11-init-list.mm | ||
arc-cxx11-member-init.mm | ||
arc-exceptions.mm | ||
arc-forwarded-lambda-call.mm | ||
arc-globals.mm | ||
arc-indirect.mm | ||
arc-list-init-destruct.mm | ||
arc-mangle.mm | ||
arc-marker-funclet.mm | ||
arc-move.mm | ||
arc-new-delete.mm | ||
arc-pseudo-destructors.mm | ||
arc-references.mm | ||
arc-returns-inner-reference-ptr.mm | ||
arc-special-member-functions.mm | ||
arc-weak.mm | ||
arc.mm | ||
auto-release-result-assert.mm | ||
block-default-arg.mm | ||
block-id.mm | ||
block-in-template-inst.mm | ||
block-nested-in-lambda.mm | ||
block-var-layout.mm | ||
blocks.mm | ||
boxing.mm | ||
catch-id-type.mm | ||
copy.mm | ||
copyable-property-object.mm | ||
crash-function-type.mm | ||
debug-info-block-capture-this.mm | ||
debug-info-cyclic.mm | ||
debug-info-line.mm | ||
debug-info.mm | ||
designated-initializers.mm | ||
destroy.mm | ||
encode.mm | ||
exception-cxx.mm | ||
exceptions-legacy.mm | ||
exceptions.mm | ||
externally-initialized-selectors.mm | ||
foreach-statement.mm | ||
gc.mm | ||
implementation-in-extern-c.mm | ||
implicit-copy-assign-operator.mm | ||
implicit-copy-constructor.mm | ||
inheriting-constructor-cleanup.mm | ||
instantiate-return.mm | ||
ivar-objects.mm | ||
lambda-expressions.mm | ||
lambda-to-block.mm | ||
literals.mm | ||
lvalue-reference-getter.mm | ||
mangle-blocks.mm | ||
mangle.mm | ||
message-reference.mm | ||
message.mm | ||
method-local-extern-mangle.mm | ||
microsoft-abi-arc-param-order.mm | ||
mrc-weak.mm | ||
msabi-objc-extensions.mm | ||
msabi-objc-types.mm | ||
msabi-stret.mm | ||
nested-ehlocation.mm | ||
nrvo.mm | ||
objc-container-subscripting-1.mm | ||
objc-container-subscripting.mm | ||
objc-struct-cxx-abi.mm | ||
objc-weak.mm | ||
objfw-exceptions.mm | ||
os_log.mm | ||
personality-abuse.mm | ||
personality.mm | ||
pr14474-gline-tables-only.mm | ||
property-derived-to-base-conv.mm | ||
property-dot-copy-elision.mm | ||
property-dot-copy.mm | ||
property-dot-reference.mm | ||
property-lvalue-capture.mm | ||
property-lvalue-lambda.mm | ||
property-object-conditional-exp.mm | ||
property-object-reference-1.mm | ||
property-object-reference-2.mm | ||
property-object-reference.mm | ||
property-objects.mm | ||
property-reference.mm | ||
refence-assign-write-barrier.mm | ||
references.mm | ||
return.mm | ||
rtti.mm | ||
selector-expr-lvalue.mm | ||
subst-sel.mm | ||
unknown-anytype.mm | ||
write-barrier-global-assign.mm |