[Bug c++/95597] New: Rejects using-declaration with "typename" in global area

haoxintu at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue Jun 9 04:02:21 GMT 2020


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

            Bug ID: 95597
           Summary: Rejects using-declaration with "typename" in global
                    area
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: haoxintu at gmail dot com
  Target Milestone: ---

This case test.cc

typedef int T;
using typename ::T;

GCC fails to compile it.

$g++ -c test.cc
test.cc:2:18: error: expected nested-name-specifier before 'T'
    2 | using typename ::T;
      |                  ^

I guess that GCC might have something wrong in dealing with global "::" with
"typename"(the code "int a; using ::a;" is compiled ok), and this case is not
the same as bug 14258 or bug 3303. 

I also test this case in clang, icc, and msvc, they all accept test.cc.


More information about the Gcc-bugs mailing list