Open llvmbot opened 11 years ago
According to the C++11 standard, the production of the rule using-declaration is:
using typename[opt] nested-name-specifier unqualified-id ; using :: unqualified-id ;
But it seems that clang (3.1 at least) accepts also this syntax:
using typename :: unqualified-id ;
Which is not part of the standard.
The following little code illustrates this:
typedef int T; namespace foo { int T; namespace bar { using typename ::T; // < this should be rejected because of the presence of 'typename' T a; } }
This issue happens as of Clang 16.0.0: https://godbolt.org/z/n79z1Kqvd
@llvm/issue-subscribers-c-11
This code should be well-formed. See CWG1887.
Extended Description
According to the C++11 standard, the production of the rule using-declaration is:
using typename[opt] nested-name-specifier unqualified-id ; using :: unqualified-id ;
But it seems that clang (3.1 at least) accepts also this syntax:
using typename :: unqualified-id ;
Which is not part of the standard.
The following little code illustrates this: