This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/14409] New: [3.3/3.4/3.5 regression] Accepts invalid function signature for explicit instantiation
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Mar 2004 15:32:29 -0000
- Subject: [Bug c++/14409] New: [3.3/3.4/3.5 regression] Accepts invalid function signature for explicit instantiation
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
3.3, 3.4 and mainline accept this piece of invalid code (note the
missing 'const' on the signature in the explicit instantiation):
--------------------
template <typename T> struct X
{
template <typename U> void foo (U) const {};
};
template void X<int>::foo (int);
--------------------
On the other hand, 2.95 rejected this:
g/x> /home/bangerth/bin/gcc-2*/bin/c++ -c x.cc
x.cc:6: template-id `foo<>' for `X<int>::foo(int)' does not match any template
declaration
x.cc:6: confused by earlier errors, bailing out
So this is a regression.
W.
--
Summary: [3.3/3.4/3.5 regression] Accepts invalid function
signature for explicit instantiation
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Keywords: rejects-valid
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bangerth at dealii dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14409