https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111067

--- Comment #4 from Iain Sandoe <iains at gcc dot gnu.org> ---
clang on Darwin rejects the code thus:

$ ./bin/clang++ /src-local/gcc-master/gcc/testsuite/g++.dg/opt/icf1.C -o i1
-std=c++14
/src-local/gcc-master/gcc/testsuite/g++.dg/opt/icf1.C:5:3: error:
'no_unique_address' attribute only applies to non-bit-field non-static data
members
    5 | [[no_unique_address]] extern const int i[] = { 1,2,3 };

this seems to agree with the current WD:
https://eel.is/c++draft/dcl.attr.nouniqueaddr

"9.12.11 No unique address attribute [dcl.attr.nouniqueaddr]

1 #
The attribute-token no_unique_address specifies that a non-static data member
is a potentially-overlapping subobject ([intro.object]). No
attribute-argument-clause shall be present. The attribute may appertain to a
non-static data member other than a bit-field.
"

since the objects in the test case are not non-static, non-bitfield data
members, any application of the attribute would be a GCC extension, I guess?

What is the intent?

Reply via email to