This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/14912] Do not print default template arguments in error messages
- From: "giovannibajo at libero dot it" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Mar 2005 02:44:43 -0000
- Subject: [Bug c++/14912] Do not print default template arguments in error messages
- References: <20040410193158.14912.schnetter@aei.mpg.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From giovannibajo at libero dot it 2005-03-23 02:44 -------
I'll try to do this. This is a simple testcase:
---------------------------
template <class T, int N=0, int X=1>
struct A
{
typedef typename T::x x;
};
void foo(void)
{
A<void,0> a;
}
---------------------------
test.cc: At global scope:
test.cc: In instantiation of 'A<void, 0, 1>':
test.cc:8: instantiated from here
test.cc:4: error: 'void' is not a class, struct, or union type
Do we want the error message to show 'A<void, 0>' or 'A<void>'? In other words,
should GCC try and remember which arguments were really specified in the
template-id (hard to do), or a simple check of equalness between the argument
and the default parameter would suffice?
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |dave at boost-consulting dot
| |com
AssignedTo|unassigned at gcc dot gnu |giovannibajo at libero dot
|dot org |it
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14912