[Bug c++/82270] incorrect warning [-Wignored-attributes]

msebor at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Sep 20 20:57:00 GMT 2017


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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2017-09-20
                 CC|                            |msebor at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
Confirmed with a Sparc/Solaris cross-compiler built from recent trunk (8.0) and
the simplified test case below:

$ cat t.C && /build/sparcv9-sun-solaris2.11/gcc-trunk/gcc/xgcc -B
/build/sparcv9-sun-solaris2.11/gcc-trunk/gcc -S -Wall -Wextra t.C
template <int N>
struct __attribute__ ((__aligned__ (N))) A
{
  typedef A type;
};

template <class T>
struct B
{
  static constexpr int value = alignof (T);
};

static_assert (8 == B<A<8> >::value);        // no warning (good)
static_assert (8 == B<A<8>::type>::value);   // bogus warning

t.C:14:33: warning: ignoring attributes on template argument ‘A<8>::type {aka
A<8>}’ [-Wignored-attributes]
 static_assert (8 == B<A<8>::type>::value);   // bogus warning
                                 ^


More information about the Gcc-bugs mailing list