From: Giovanni Bajo Date: Mon, 23 Feb 2004 12:44:22 +0000 (+0000) Subject: re PR c++/14250 (switch() does not seem to see operator int() in template class) X-Git-Tag: releases/gcc-4.0.0~9923 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9bdfe70405125e57b5ef92bba66eb268c43ab1d4;p=thirdparty%2Fgcc.git re PR c++/14250 (switch() does not seem to see operator int() in template class) PR c++/14250 * g++.dg/other/switch1.C: New test. From-SVN: r78295 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f62f2946be5f..40ea07f01907 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-02-23 Giovanni Bajo + + PR c++/14250 + * g++.dg/other/switch1.C: New test. + 2004-02-23 Eric Botcazou * gcc.dg/cast-function-1.c: Adjust for new informative message. diff --git a/gcc/testsuite/g++.dg/other/switch1.C b/gcc/testsuite/g++.dg/other/switch1.C new file mode 100644 index 000000000000..a22d2b573faa --- /dev/null +++ b/gcc/testsuite/g++.dg/other/switch1.C @@ -0,0 +1,20 @@ +// { dg-do compile } +// Contributed by: Nick Savoiu +// PR c++/14250: Incomplete type in switch statement + +template +struct A { + operator int(); +}; + +struct C1 { + static A t1; + + void fun() + { + switch(t1) + { + default: break; + } + } +};