This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/12531] New: Error specializing a class template to form a default value of a constructor argument
- From: "jfranzoy at yahoo dot com dot ar" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Oct 2003 21:15:49 -0000
- Subject: [Bug c++/12531] New: Error specializing a class template to form a default value of a constructor argument
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12531
Summary: Error specializing a class template to form a default
value of a constructor argument
Product: gcc
Version: 3.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jfranzoy at yahoo dot com dot ar
CC: gcc-bugs at gcc dot gnu dot org
GCC host triplet: mandrake linux 586
The code:
--------
template<class PRI, class SEC>
struct is_same {
enum { value = false };
};
template<class PRI>
struct is_same<PRI,PRI> {
enum { value = true };
};
struct JCF {
JCF(int i = is_same<int,int>::value ) {} /// parse error in this line
};
The error:
---------
x.cpp:10: parse error before `>' token
x.cpp:10: missing ';' before right brace
gcc -v -save-temps output
-------------------------
$ gcc -v -save-temps Reading specs from
/usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.2/specs
Configured with: ../configure --prefix=/usr --libdir=/usr/lib
--with-slibdir=/lib --mandir=/usr/share/man --infodir=/usr/share/info
--enable-shared --enable-threads=posix --disable-checking --enable-long-long
--enable-__cxa_atexit --enable-languages=c,c++,ada,f77,objc,java
--host=i586-mandrake-linux-gnu --with-system-zlib
Thread model: posix
gcc version 3.2 (Mandrake Linux 9.0 3.2-1mdk)
Additional Builds and Platforms
-------------------------------
Also occurs on gcc 3.2 on Solaris 2.6