https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88221
Bug ID: 88221 Summary: Only restricted set of balanced token sequences allowed for attributes Product: gcc Version: 8.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: o_kniemeyer at maxon dot net Target Milestone: --- Attribute arguments may be arbitrary token sequences as long as they are balanced regarding () [] {}. From C++17 10.6.1: attribute-argument-clause : ( balanced-token-seq opt ) balanced-token-seq : balanced-token balanced-token-seq balanced-token balanced-token : ( balanced-token-seqopt ) [ balanced-token-seqopt ] { balanced-token-seqopt } any token other than a parenthesis, a bracket, or a brace However GCC only allows a quite restricted set. For example the following arguments are rejected: [[myattribute(a)]] void Func(); [[myattribute(void)]] void Func(); [[myattribute(1 2)]] void Func(); [[myattribute(1:2)]] void Func(); [[myattribute([1])]] void Func();