This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/17011] New: [3.4/3.5 regression] invalid default parameter diagnosed too late
- From: "reichelt at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Aug 2004 19:39:22 -0000
- Subject: [Bug c++/17011] New: [3.4/3.5 regression] invalid default parameter diagnosed too late
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
On 3.4 branch and mainline the invalid default parameter is only
diagnosed at instantiation time and not at definition time:
======================================
template<typename> struct A {};
template<typename T> struct B
{
A<T> a;
void foo(A<T>* = &a);
void bar() { foo(); }
};
// template struct B<int>;
======================================
On the 3.3 branch we get the error message already at defintion time:
bug.cc:7: error: invalid use of member `B<T>::a'
--
Summary: [3.4/3.5 regression] invalid default parameter diagnosed
too late
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Keywords: accepts-invalid, diagnostic
Severity: enhancement
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: reichelt at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org,mark at codesourcery dot
com
BugsThisDependsOn: 16929
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17011