Revision tags: llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5 |
|
#
2e791334 |
| 07-Nov-2023 |
Jerin Philip <jerinphilip@live.in> |
[clang] Improve `_Alignas` on a `struct` declaration diagnostic (#65638)
Fixes https://github.com/llvm/llvm-project/issues/58637.
Adds `isAlignas()` method on `AttributeCommonInfo` which account
[clang] Improve `_Alignas` on a `struct` declaration diagnostic (#65638)
Fixes https://github.com/llvm/llvm-project/issues/58637.
Adds `isAlignas()` method on `AttributeCommonInfo` which accounts for
C++ `alignas` as well as C11 `_Alignas`.
The method is used to improve diagnostic in C when `_Alignas` is used in
C at the wrong location. This corrects the previously suggested move
of `_Alignas` past the declaration specifier, now warns attribute
`_Alignas` is ignored.
Based on https://reviews.llvm.org/D141177.
show more ...
|
Revision tags: llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, working, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init, llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1, llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2, llvmorg-13.0.1-rc1, llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3, llvmorg-13.0.0-rc2, llvmorg-13.0.0-rc1, llvmorg-14-init |
|
#
98322d3e |
| 10-Jul-2021 |
Corentin Jabot <corentinjabot@gmail.com> |
Complete the implementation of P2361 Unevaluated string literals
The attributes changes were left out of Clang 17. Attributes that used to take a string literal now accept an unevaluated string lite
Complete the implementation of P2361 Unevaluated string literals
The attributes changes were left out of Clang 17. Attributes that used to take a string literal now accept an unevaluated string literal instead, which means they reject numeric escape sequences and strings literal with an encoding prefix - but the later was already ill-formed in most cases.
We need to know that we are going to parse an unevaluated string literal before we do - so we can reject numeric escape sequence, so we derive from Attrs.td which attributes parameters are expected to be string literals.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D156237
show more ...
|
#
8c7b64b5 |
| 15-Jun-2022 |
Martin Boehme <mboehme@google.com> |
[clang] Reject non-declaration C++11 attributes on declarations
For backwards compatiblity, we emit only a warning instead of an error if the attribute is one of the existing type attributes that we
[clang] Reject non-declaration C++11 attributes on declarations
For backwards compatiblity, we emit only a warning instead of an error if the attribute is one of the existing type attributes that we have historically allowed to "slide" to the `DeclSpec` just as if it had been specified in GNU syntax. (We will call these "legacy type attributes" below.)
The high-level changes that achieve this are:
- We introduce a new field `Declarator::DeclarationAttrs` (with appropriate accessors) to store C++11 attributes occurring in the attribute-specifier-seq at the beginning of a simple-declaration (and other similar declarations). Previously, these attributes were placed on the `DeclSpec`, which made it impossible to reconstruct later on whether the attributes had in fact been placed on the decl-specifier-seq or ahead of the declaration.
- In the parser, we propgate declaration attributes and decl-specifier-seq attributes separately until we can place them in `Declarator::DeclarationAttrs` or `DeclSpec::Attrs`, respectively.
- In `ProcessDeclAttributes()`, in addition to processing declarator attributes, we now also process the attributes from `Declarator::DeclarationAttrs` (except if they are legacy type attributes).
- In `ConvertDeclSpecToType()`, in addition to processing `DeclSpec` attributes, we also process any legacy type attributes that occur in `Declarator::DeclarationAttrs` (and emit a warning).
- We make `ProcessDeclAttribute` emit an error if it sees any non-declaration attributes in C++11 syntax, except in the following cases: - If it is being called for attributes on a `DeclSpec` or `DeclaratorChunk` - If the attribute is a legacy type attribute (in which case we only emit a warning)
The standard justifies treating attributes at the beginning of a simple-declaration and attributes after a declarator-id the same. Here are some relevant parts of the standard:
- The attribute-specifier-seq at the beginning of a simple-declaration "appertains to each of the entities declared by the declarators of the init-declarator-list" (https://eel.is/c++draft/dcl.dcl#dcl.pre-3)
- "In the declaration for an entity, attributes appertaining to that entity can appear at the start of the declaration and after the declarator-id for that declaration." (https://eel.is/c++draft/dcl.dcl#dcl.pre-note-2)
- "The optional attribute-specifier-seq following a declarator-id appertains to the entity that is declared." (https://eel.is/c++draft/dcl.dcl#dcl.meaning.general-1)
The standard contains similar wording to that for a simple-declaration in other similar types of declarations, for example:
- "The optional attribute-specifier-seq in a parameter-declaration appertains to the parameter." (https://eel.is/c++draft/dcl.fct#3)
- "The optional attribute-specifier-seq in an exception-declaration appertains to the parameter of the catch clause" (https://eel.is/c++draft/except.pre#1)
The new behavior is tested both on the newly added type attribute `annotate_type`, for which we emit errors, and for the legacy type attribute `address_space` (chosen somewhat randomly from the various legacy type attributes), for which we emit warnings.
Depends On D111548
Reviewed By: aaron.ballman, rsmith
Differential Revision: https://reviews.llvm.org/D126061
show more ...
|
#
ead1690d |
| 08-Feb-2022 |
Steffen Larsen <steffen.larsen@intel.com> |
Allow parameter pack expansions and initializer lists in annotate attribute
These changes make the Clang parser recognize expression parameter pack expansion and initializer lists in attribute argum
Allow parameter pack expansions and initializer lists in annotate attribute
These changes make the Clang parser recognize expression parameter pack expansion and initializer lists in attribute arguments. Because expression parameter pack expansion requires additional handling while creating and instantiating templates, the support for them must be explicitly supported through the AcceptsExprPack flag.
Handling expression pack expansions may require a delay to when the arguments of an attribute are correctly populated. To this end, attributes that are set to accept these - through setting the AcceptsExprPack flag - will automatically have an additional variadic expression argument member named DelayedArgs. This member is not exposed the same way other arguments are but is set through the new CreateWithDelayedArgs creator function generated for applicable attributes.
To illustrate how to implement support for expression pack expansion support, clang::annotate is made to support pack expansions. This is done by making handleAnnotationAttr delay setting the actual attribute arguments until after template instantiation if it was unable to populate the arguments due to dependencies in the parsed expressions.
show more ...
|
#
27ea0c4e |
| 11-Nov-2021 |
Sam McCall <sam.mccall@gmail.com> |
[Parse] Use empty RecoveryExpr when if/while/do/switch conditions fail to parse
This allows the body to be parsed. An special-case that would replace a missing if condition with OpaqueValueExpr was
[Parse] Use empty RecoveryExpr when if/while/do/switch conditions fail to parse
This allows the body to be parsed. An special-case that would replace a missing if condition with OpaqueValueExpr was removed as it's now redundant (unless recovery-expr is disabled).
For loops are not handled at this point, as the parsing is more complicated.
Differential Revision: https://reviews.llvm.org/D113752
show more ...
|
Revision tags: llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3, llvmorg-12.0.1-rc2 |
|
#
97d23493 |
| 31-May-2021 |
Louis Dionne <ldionne.2@gmail.com> |
[clang][Parse] Add parsing support for C++ attributes on using-declarations
This is a re-application of dc67299 which was reverted in f63adf5b because it broke the build. The issue should now be fix
[clang][Parse] Add parsing support for C++ attributes on using-declarations
This is a re-application of dc67299 which was reverted in f63adf5b because it broke the build. The issue should now be fixed.
Attribution note: The original author of this patch is Erik Pilkington. I'm only trying to land it after rebasing.
Differential Revision: https://reviews.llvm.org/D91630
show more ...
|
#
f63adf5b |
| 28-May-2021 |
Nico Weber <thakis@chromium.org> |
Revert "[clang][Parse] Add parsing support for C++ attributes on using-declarations"
This reverts commit dc672999a9b12a156991891dc400308b52d569ba. Breaks check-clang everywhere, see https://reviews.
Revert "[clang][Parse] Add parsing support for C++ attributes on using-declarations"
This reverts commit dc672999a9b12a156991891dc400308b52d569ba. Breaks check-clang everywhere, see https://reviews.llvm.org/D91630
show more ...
|
Revision tags: llvmorg-12.0.1-rc1 |
|
#
dc672999 |
| 21-May-2021 |
Erik Pilkington <erik.pilkington@gmail.com> |
[clang][Parse] Add parsing support for C++ attributes on using-declarations
Differential Revision: https://reviews.llvm.org/D91630
|
Revision tags: llvmorg-12.0.0, llvmorg-12.0.0-rc5 |
|
#
241d42c3 |
| 04-Apr-2021 |
Aaron Ballman <aaron@aaronballman.com> |
Speculative fix for failing build bot.
This attempts to resolve an issue found by http://45.33.8.238/macm1/6821/step_6.txt
|
Revision tags: llvmorg-12.0.0-rc4 |
|
#
1b4800c2 |
| 25-Mar-2021 |
Timm Bäder <tbaeder@redhat.com> |
[clang][parser] Set source ranges for GNU-style attributes
Set the source ranges for parsed GNU-style attributes in ParseGNUAttributes(), the same way that ParseCXX11Attributes() does it.
Different
[clang][parser] Set source ranges for GNU-style attributes
Set the source ranges for parsed GNU-style attributes in ParseGNUAttributes(), the same way that ParseCXX11Attributes() does it.
Differential Revision: https://reviews.llvm.org/D75844
show more ...
|
Revision tags: llvmorg-12.0.0-rc3 |
|
#
5018e15f |
| 03-Mar-2021 |
Timm Bäder <tbaeder@redhat.com> |
[clang][parser] Allow GNU-style attributes in explicit template...
... instantiations
They are currently not being diagnosed because ProhibitAttributes() does not handle attribute lists with an inv
[clang][parser] Allow GNU-style attributes in explicit template...
... instantiations
They are currently not being diagnosed because ProhibitAttributes() does not handle attribute lists with an invalid source range. But once it does, we need to allow GNU attributes in this place.
Additionally, start optionally diagnosing empty attr lists in ProhibitCXX11Attributes(), since ProhibitAttribute() does it.
Differential Revision: https://reviews.llvm.org/D97362
show more ...
|
Revision tags: llvmorg-12.0.0-rc2, llvmorg-11.1.0, llvmorg-11.1.0-rc3, llvmorg-12.0.0-rc1, llvmorg-13-init, llvmorg-11.1.0-rc2, llvmorg-11.1.0-rc1, llvmorg-11.0.1, llvmorg-11.0.1-rc2, llvmorg-11.0.1-rc1, llvmorg-11.0.0, llvmorg-11.0.0-rc6, llvmorg-11.0.0-rc5, llvmorg-11.0.0-rc4, llvmorg-11.0.0-rc3, llvmorg-11.0.0-rc2, llvmorg-11.0.0-rc1, llvmorg-12-init, llvmorg-10.0.1, llvmorg-10.0.1-rc4, llvmorg-10.0.1-rc3, llvmorg-10.0.1-rc2, llvmorg-10.0.1-rc1, llvmorg-10.0.0, llvmorg-10.0.0-rc6, llvmorg-10.0.0-rc5, llvmorg-10.0.0-rc4, llvmorg-10.0.0-rc3, llvmorg-10.0.0-rc2, llvmorg-10.0.0-rc1, llvmorg-11-init, llvmorg-9.0.1, llvmorg-9.0.1-rc3, llvmorg-9.0.1-rc2, llvmorg-9.0.1-rc1, llvmorg-9.0.0, llvmorg-9.0.0-rc6, llvmorg-9.0.0-rc5, llvmorg-9.0.0-rc4, llvmorg-9.0.0-rc3, llvmorg-9.0.0-rc2, llvmorg-9.0.0-rc1, llvmorg-10-init, llvmorg-8.0.1, llvmorg-8.0.1-rc4, llvmorg-8.0.1-rc3, llvmorg-8.0.1-rc2, llvmorg-8.0.1-rc1, llvmorg-8.0.0, llvmorg-8.0.0-rc5, llvmorg-8.0.0-rc4, llvmorg-8.0.0-rc3, llvmorg-7.1.0, llvmorg-7.1.0-rc1, llvmorg-8.0.0-rc2, llvmorg-8.0.0-rc1, llvmorg-7.0.1, llvmorg-7.0.1-rc3 |
|
#
c44c1742 |
| 09-Nov-2018 |
Aaron Ballman <aaron@aaronballman.com> |
Introduce the _Clang scoped attribute token.
Currently, we only accept clang as the scoped attribute identifier for double square bracket attributes provided by Clang, but this has the potential to
Introduce the _Clang scoped attribute token.
Currently, we only accept clang as the scoped attribute identifier for double square bracket attributes provided by Clang, but this has the potential to conflict with user-defined macros. To help alleviate these concerns, this introduces the _Clang scoped attribute identifier as an alias for clang. It also introduces a warning with a fixit on the off chance someone attempts to use __clang__ as the scoped attribute (which is a predefined compiler identification macro).
llvm-svn: 346521
show more ...
|
Revision tags: llvmorg-7.0.1-rc2, llvmorg-7.0.1-rc1, llvmorg-7.0.0, llvmorg-7.0.0-rc3, llvmorg-7.0.0-rc2, llvmorg-7.0.0-rc1, llvmorg-6.0.1, llvmorg-6.0.1-rc3, llvmorg-6.0.1-rc2, llvmorg-6.0.1-rc1, llvmorg-5.0.2, llvmorg-5.0.2-rc2, llvmorg-5.0.2-rc1, llvmorg-6.0.0, llvmorg-6.0.0-rc3, llvmorg-6.0.0-rc2, llvmorg-6.0.0-rc1 |
|
#
c5089c08 |
| 25-Dec-2017 |
Faisal Vali <faisalv@yahoo.com> |
Add a fixit for attributes incorrectly placed prior to 'struct/class/enum' keyword.
Suggest moving the following erroneous attrib list (based on location) [[]] struct X; to struct [[]] X;
Additi
Add a fixit for attributes incorrectly placed prior to 'struct/class/enum' keyword.
Suggest moving the following erroneous attrib list (based on location) [[]] struct X; to struct [[]] X;
Additionally, added a fixme for the current implementation that diagnoses misplaced attributes to consider using the newly introduced diagnostic (that I think is more user-friendly).
llvm-svn: 321449
show more ...
|
Revision tags: llvmorg-5.0.1, llvmorg-5.0.1-rc3, llvmorg-5.0.1-rc2 |
|
#
adf66b61 |
| 26-Nov-2017 |
Aaron Ballman <aaron@aaronballman.com> |
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
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.
This also clarifies some terminology used by the diagnostic (methods -> Objective-C methods, fields -> non-static data members, etc).
Many of the tests needed to be updated in multiple places for the diagnostic wording tweaks. The first instance of the diagnostic for that attribute is fully specified and subsequent instances cut off the complete list (to make it easier if additional subjects are added in the future for the attribute).
llvm-svn: 319002
show more ...
|
Revision tags: llvmorg-5.0.1-rc1 |
|
#
40e202f7 |
| 14-Oct-2017 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Fix backwards warning for use of C++17 attributes-on-namespaces-and-enumerators feature.
llvm-svn: 315784
|
Revision tags: llvmorg-5.0.0, llvmorg-5.0.0-rc5, llvmorg-5.0.0-rc4, llvmorg-5.0.0-rc3 |
|
#
cbaaa295 |
| 13-Aug-2017 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Replace remaining user-visible mentions of C++1z with C++17.
llvm-svn: 310804
|
Revision tags: llvmorg-5.0.0-rc2, llvmorg-5.0.0-rc1, llvmorg-4.0.1, llvmorg-4.0.1-rc3, llvmorg-4.0.1-rc2, llvmorg-4.0.1-rc1, llvmorg-4.0.0, llvmorg-4.0.0-rc4, llvmorg-4.0.0-rc3, llvmorg-4.0.0-rc2 |
|
#
8f8697f3 |
| 08-Feb-2017 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Fix constructor declarator detection for the case when the name is followed by an attribute-specifier-seq. (Also fixes the same problem for deduction-guides.)
llvm-svn: 294396
|
Revision tags: llvmorg-4.0.0-rc1, llvmorg-3.9.1, llvmorg-3.9.1-rc3, llvmorg-3.9.1-rc2, llvmorg-3.9.1-rc1, llvmorg-3.9.0, llvmorg-3.9.0-rc3, llvmorg-3.9.0-rc2, llvmorg-3.9.0-rc1, llvmorg-3.8.1, llvmorg-3.8.1-rc1 |
|
#
bb5d862a |
| 08-Mar-2016 |
Aaron Ballman <aaron@aaronballman.com> |
Silence duplicate diagnostics because parsing of a standards-based attribute triggers parsing diagnostics that may also be picked up during semantic analysis.
llvm-svn: 262960
|
#
4f902c7e |
| 08-Mar-2016 |
Richard Smith <richard-llvm@metafoo.co.uk> |
P0188R1: add support for standard [[fallthrough]] attribute. This is almost exactly the same as clang's existing [[clang::fallthrough]] attribute, which has been updated to have the same semantics. T
P0188R1: add support for standard [[fallthrough]] attribute. This is almost exactly the same as clang's existing [[clang::fallthrough]] attribute, which has been updated to have the same semantics. The one significant difference is that [[fallthrough]] is ill-formed if it's not used immediately before a switch label (even when -Wimplicit-fallthrough is disabled). To support that, we now build a CFG of any function that uses a '[[fallthrough]];' statement to check.
In passing, fix some bugs with our support for statement attributes -- in particular, diagnose their use on declarations, rather than asserting.
llvm-svn: 262881
show more ...
|
Revision tags: llvmorg-3.8.0, llvmorg-3.8.0-rc3, llvmorg-3.8.0-rc2, llvmorg-3.8.0-rc1, llvmorg-3.7.1, llvmorg-3.7.1-rc2, llvmorg-3.7.1-rc1 |
|
#
e4e3e6a5 |
| 08-Oct-2015 |
David Majnemer <david.majnemer@gmail.com> |
[Sema] Tweak incomplete enum types on MSVC ABI targets
Enums without an explicit, fixed, underlying type are implicitly given a fixed 'int' type for ABI compatibility with MSVC. However, we can enf
[Sema] Tweak incomplete enum types on MSVC ABI targets
Enums without an explicit, fixed, underlying type are implicitly given a fixed 'int' type for ABI compatibility with MSVC. However, we can enforce the standard-mandated rules on these types as-if we didn't know this fact if the tag is not part of a definition.
llvm-svn: 249667
show more ...
|
#
c10b8381 |
| 08-Oct-2015 |
David Majnemer <david.majnemer@gmail.com> |
Update tests touched by r249656
These test updates almost exclusively around the change in behavior around enum: enums without a definition are considered incomplete except when targeting MSVC ABIs.
Update tests touched by r249656
These test updates almost exclusively around the change in behavior around enum: enums without a definition are considered incomplete except when targeting MSVC ABIs. Since these tests are interested in the 'incomplete-enum' behavior, restrict them to %itanium_abi_triple.
llvm-svn: 249660
show more ...
|
Revision tags: llvmorg-3.7.0, llvmorg-3.7.0-rc4, llvmorg-3.7.0-rc3, studio-1.4, llvmorg-3.7.0-rc2, llvmorg-3.7.0-rc1, llvmorg-3.6.2, llvmorg-3.6.2-rc1, llvmorg-3.6.1, llvmorg-3.6.1-rc1 |
|
#
60be563f |
| 29-Mar-2015 |
Benjamin Kramer <benny.kra@googlemail.com> |
[parse] Don't crash on alternative operator spellings from macros in c++11 attributes.
Found by afl-fuzz.
llvm-svn: 233499
|
Revision tags: llvmorg-3.5.2, llvmorg-3.5.2-rc1, llvmorg-3.6.0, llvmorg-3.6.0-rc4 |
|
#
f25731a4 |
| 16-Feb-2015 |
Aaron Ballman <aaron@aaronballman.com> |
Minor tweaks to r229447 to ensure the attribute is properly quoted when diagnosed.
llvm-svn: 229454
|
#
f931a389 |
| 16-Feb-2015 |
Saleem Abdulrasool <compnerd@compnerd.org> |
Sema: diagnose use of unscoped deprecated prior to C++14
The deprecated attribute was adopted as part of the C++14, however, there is a GNU version available in C++11. When using C++ earlier than C
Sema: diagnose use of unscoped deprecated prior to C++14
The deprecated attribute was adopted as part of the C++14, however, there is a GNU version available in C++11. When using C++ earlier than C++14, diagnose the use of the attribute without the GNU scope, but only when using the generalised attribute syntax.
llvm-svn: 229447
show more ...
|
Revision tags: llvmorg-3.6.0-rc3, llvmorg-3.6.0-rc2, llvmorg-3.6.0-rc1 |
|
#
d527199c |
| 09-Jan-2015 |
David Majnemer <david.majnemer@gmail.com> |
Parse: Don't crash when an annotation token shows up in a C++11 attr
It's not safe to blindly call getIdentifierInfo without checking the token is not an annotation token.
llvm-svn: 225533
|