This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/14244] New: Regression failure with v3.3: uninstantiated template code not ignored


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]