This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/71679] gcc silently accepts parameter number mismatch in template redeclaration


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;
                       ^

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]