// { dg-do compile } // { dg-options "-std=gnu++0x" } #include <typeinfo> struct S; template <typename T> static bool fn (S *s) { return typeid (*s) == typeid (T); } struct S { }; bool x = fn<S> (__null); is rejected with --enable-checking=yes compilers (but accepted with release checking compilers), starting with http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=173679 Is this code valid C++ or not, i.e. is the FE allowed to warn about incomplete types even in the uninstantiated template?
Definitely P1, we should be consistent with accepting/rejecting code with/without checking enabled.
This is a bug that only appears with --enable-checking; I don't see how that merits P1.
Author: jason Date: Thu Jan 10 02:54:39 2013 New Revision: 195075 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195075 Log: PR c++/55878 * rtti.c (build_typeid, get_typeid): Add complain parm. (get_tinfo_decl_dynamic): Likewise. * cp-tree.h, parser.c, pt.c: Adjust. Added: trunk/gcc/testsuite/g++.dg/template/typeid1.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/cp-tree.h trunk/gcc/cp/parser.c trunk/gcc/cp/pt.c trunk/gcc/cp/rtti.c
Fixed for 4.8. No point fixing in 4.7 a bug that only comes up with --enable-checking.