In N3291 “7.6.1.(3/5) Attribute Syntax and semantics [decl.attr.grammar]” concerning how attributes are written in source code I read
The use of an attribute-scoped-token is conditionally-supported, with
implementation-defined behavior.
and
For an attribute-token not specified in this International Standard, the behavior is implementation-defined.
Does this mean, that attribute specifications like
[[ dllexport ]]
[[ hiding ]]
[[ unused ]]
[[ vendor::attrib ]]
may be complained about by a standard conforming compiler? So, it could report an error and stop compilation?
I would have hoped that a compiler should ignore attributes that it does not know how to handle them. Ok, that might be dangerous, because typos in attributes may be overlooked, for example [[ noretrun ]] or [[ carrys_dependencie ]] 🙂
But especially namespaces would help here, right? When I compile [[ gcc::mips ]] on an Microsoft compiler that one should be able to ignore that and not reject it, right?
C++17 adds an explicit statement that attributes not recognized by an implementation are to be ignored. Before C++17, all attribute behavior was implementation defined, so the implementation could do anything.
Part of the purpose of the attribute specification is so that compiler makers will stop cluttering the language up with special syntax and keywords. To give them a single grammar for specifying these things. It is a way to associate a compiler-defined string with a particular object or definition.