This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/14244] New: Regression failure with v3.3: uninstantiated template code not ignored
- From: "s_gccbugzilla at nedprod dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Feb 2004 18:17:50 -0000
- Subject: [Bug c++/14244] New: Regression failure with v3.3: uninstantiated template code not ignored
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Default options, GCC v3.4 CVS 20040218.
The below compiles on v3.3 of GCC and MSVC. I believe the standard says that
code not instantiated should not be compiled except for syntax checking.
/* Test for error throwing bug */
#include <stdio.h>
template<bool error> struct Foo
{
enum { value=ERROR_Not_Valid };
};
template<> struct Foo<true>
{
enum { value=1 };
};
int main(void)
{
printf("Val=%d\n", Foo<true>::value);
}
Cheers,
Niall
--
Summary: Regression failure with v3.3: uninstantiated template
code not ignored
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: critical
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: s_gccbugzilla at nedprod dot com
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14244