<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="/rss.xsl.xml"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
    <title>Changes in annotate-type.cpp</title>
    <description></description>
    <language>en</language>
    <copyright>Copyright 2015</copyright>
    <generator>Java</generator><item>
        <title>8c7b64b5 - [clang] Reject non-declaration C++11 attributes on declarations</title>
        <link>http://172.16.0.5:8080/history/llvm-project-15.0.7/clang/test/SemaCXX/annotate-type.cpp#8c7b64b5</link>
        <description>[clang] Reject non-declaration C++11 attributes on declarationsFor backwards compatiblity, we emit only a warning instead of an error if theattribute is one of the existing type attributes that we have historicallyallowed to &quot;slide&quot; to the `DeclSpec` just as if it had been specified in GNUsyntax. (We will call these &quot;legacy type attributes&quot; 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 asimple-declaration and attributes after a declarator-id the same. Here are somerelevant parts of the standard:- The attribute-specifier-seq at the beginning of a simple-declaration  &quot;appertains to each of the entities declared by the declarators of the  init-declarator-list&quot; (https://eel.is/c++draft/dcl.dcl#dcl.pre-3)- &quot;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.&quot; (https://eel.is/c++draft/dcl.dcl#dcl.pre-note-2)- &quot;The optional attribute-specifier-seq following a declarator-id appertains to  the entity that is declared.&quot;  (https://eel.is/c++draft/dcl.dcl#dcl.meaning.general-1)The standard contains similar wording to that for a simple-declaration in othersimilar types of declarations, for example:- &quot;The optional attribute-specifier-seq in a parameter-declaration appertains to  the parameter.&quot; (https://eel.is/c++draft/dcl.fct#3)- &quot;The optional attribute-specifier-seq in an exception-declaration appertains  to the parameter of the catch clause&quot; (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 typeattributes), for which we emit warnings.Depends On D111548Reviewed By: aaron.ballman, rsmithDifferential Revision: https://reviews.llvm.org/D126061

            List of files:
            /llvm-project-15.0.7/clang/test/SemaCXX/annotate-type.cpp</description>
        <pubDate>Wed, 15 Jun 2022 06:07:23 +0000</pubDate>
        <dc:creator>Martin Boehme &lt;mboehme@google.com&gt;</dc:creator>
    </item>
<item>
        <title>665da187 - [Clang] Add the `annotate_type` attribute</title>
        <link>http://172.16.0.5:8080/history/llvm-project-15.0.7/clang/test/SemaCXX/annotate-type.cpp#665da187</link>
        <description>[Clang] Add the `annotate_type` attributeThis is an analog to the `annotate` attribute but for types. The intent is to allow adding arbitrary annotations to types for use in static analysis tools.For details, see this RFC:https://discourse.llvm.org/t/rfc-new-attribute-annotate-type-iteration-2/61378Reviewed By: aaron.ballmanDifferential Revision: https://reviews.llvm.org/D111548

            List of files:
            /llvm-project-15.0.7/clang/test/SemaCXX/annotate-type.cpp</description>
        <pubDate>Wed, 15 Jun 2022 06:08:10 +0000</pubDate>
        <dc:creator>Martin Boehme &lt;mboehme@google.com&gt;</dc:creator>
    </item>
</channel>
</rss>
