This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/86501] New: shadow template parameter
- From: "zhonghao at pku dot org.cn" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 12 Jul 2018 00:52:26 +0000
- Subject: [Bug c++/86501] New: shadow template parameter
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86501
Bug ID: 86501
Summary: shadow template parameter
Product: gcc
Version: 8.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: zhonghao at pku dot org.cn
Target Milestone: ---
The code is as follows:
template < int V >
struct A
{
struct B
{
template < int > friend struct V;
};
};
A < 0 >::B a;
g++ accepts the code, but clang++ rejects it:
error: declaration of 'V' shadows template parameter
template < int > friend struct V;
^
note: template parameter is declared here
template < int V >
^
1 error generated.