[Bug c++/93809] New: bogus error class tag used in naming union on typedef typename ::U U2
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Feb 18 17:02:00 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93809
Bug ID: 93809
Summary: bogus error class tag used in naming union on typedef
typename ::U U2
Product: gcc
Version: 10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: msebor at gcc dot gnu.org
Target Milestone: ---
While testing a fix for pr93801 I noticed that G++ rejects the last type
definition in the test case below. The code looks valid to me and is accepted
by all other compilers I tried (Clang, ICC, and Visual C++).
$ cat t.C && gcc -S t.C
class C { };
enum E { };
struct S { };
union U { };
typedef typename ::C C2;
typedef typename ::E E2;
typedef typename ::S S2;
typedef typename ::U U2; // error
t.C:9:20: error: ‘class’ tag used in naming ‘union U’ [-fpermissive]
9 | typedef typename ::U U2; // error
| ^
t.C:4:7: note: ‘union U’ was previously declared here
4 | union U { };
| ^
More information about the Gcc-bugs
mailing list