This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/58855] Attributes ignored on type alias in template


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

ncm at cantrip dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ncm at cantrip dot org

--- Comment #1 from ncm at cantrip dot org ---
This bug is still present in g++-5.3.1:

$ cat usingbug.cc

template <unsigned N>
struct S {
  typedef    unsigned  __attribute__((vector_size(N*sizeof(unsigned)))) T1;
  using T2 = unsigned  __attribute__((vector_size(N*sizeof(unsigned))));
};

int main()
{
    S<4u>::T1 v1;
    S<4u>::T2 v2;

    return v1[1] + v2[2];
}

$ g++ -std=c++14 usingbug.cc 
usingbug.cc: In function âint main()â:
usingbug.cc:13:24: error: invalid types âS<4u>::T2 {aka unsigned int}[int]â for
array subscript
     return v1[1] + v2[2];
                        ^
$ g++ --version
g++ (Debian 5.3.1-4) 5.3.1 20151219

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]