[cfe-dev] GCC 6 Warnings

Renato Golin via cfe-dev cfe-dev at lists.llvm.org
Thu Sep 8 13:20:56 PDT 2016


On 8 September 2016 at 21:07, Milian Wolff <mail at milianw.de> wrote:
> I think this could be related:
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71463

Hum, it does look like the same problem.

Eric, one of the comments was:

"The attribute isn't properly part of the C++ type, so in the testcase
below A<fna> needs to be the same type as A<fn>, and so they share a
member function.  So we have to choose which type to use as the
canonical type, and we choose the type without the attribute.  And
that's what the "ignoring attributes" warning is telling you.

typedef int fn();
typedef int fna() __attribute ((warn_unused_result));"

Do we use the Casting classes with Stmt (which has alignment
attribute) as well as with other classes that don't have any
attributes?

Anyway, this seems like a silly warning in templates, as you're
expected to use it with multiple types and they can have different
attributes anyway.

How is c++17 attributes going to work in this case? I assume they're
going to be different types (in decltype's eyes), so GCC could do a
similar implementation.

cheers,
--renato


More information about the cfe-dev mailing list