This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/71679] New: 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 05:23:41 +0000
- Subject: [Bug c++/71679] New: gcc silently accepts parameter number mismatch in template redeclaration
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71679
Bug ID: 71679
Summary: gcc silently accepts parameter number mismatch in
template redeclaration
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: trippels at gcc dot gnu.org
Target Milestone: ---
markus@x4 tmp % cat llvm.ii
namespace name {
template <int> struct A;
}
struct B {
template <int, int> friend struct name::A;
};
markus@x4 tmp % icpc -c llvm.ii
llvm.ii(5): warning #549: too many template parameters -- does not match
previous declaration (declared at line 2)
template <int, int> friend struct name::A;
^
markus@x4 tmp % clang++ -c llvm.ii
llvm.ii:5:3: error: too many template parameters in template redeclaration
template <int, int> friend struct name::A;
^~~~~~~~~~~~~~~~~~~
llvm.ii:2:1: note: previous template declaration is here
template <int> struct A;
^~~~~~~~~~~~~~
1 error generated.
markus@x4 tmp % g++ -Wall -Wextra -c llvm.ii
markus@x4 tmp %