This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/71679] gcc silently accepts parameter number mismatch in template redeclaration
- From: "trippels at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 28 Jun 2016 12:58:59 +0000
- Subject: [Bug c++/71679] gcc silently accepts parameter number mismatch in template redeclaration
- Auto-submitted: auto-generated
- References: <bug-71679-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71679
--- Comment #1 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
The testcase can be further reduced:
template <int> struct A;
struct B {
template <int, int> friend struct ::A;
};
When using A instead of ::A it works fine and gcc errors out:
llvm.ii:3:37: error: redeclared with 2 template parameters
template <int, int> friend struct A;
^
llvm.ii:1:23: note: previous declaration âtemplate<int <anonymous> > struct Aâ
used 1 template parameter
template <int> struct A;
^