===================================================================
@@ -9396,6 +9396,8 @@ is_std_init_list (tree type)
/* Look through typedefs. */
if (!TYPE_P (type))
return false;
+ if (cxx_dialect == cxx98)
+ return false;
type = TYPE_MAIN_VARIANT (type);
return (CLASS_TYPE_P (type)
&& CP_TYPE_CONTEXT (type) == std_node
===================================================================
@@ -0,0 +1,10 @@
+// PR c++/57947
+// { dg-options "-std=c++98" }
+
+namespace std
+{
+ template <class E> class initializer_list {};
+ template <int N> struct D { D(initializer_list<int>) {} };
+ D<0> d {1, 2, 3}; // { dg-error "constructor|no matching" }
+ // { dg-warning "initializer list" "" { target *-*-* } 8 }
+}
Hi, On 07/30/2013 03:30 PM, Jason Merrill wrote: > How about just returning false from is_std_init_list in C++98 mode? Sure. It works great. Thanks, Paolo. //////////////////// /cp 2013-07-30 Paolo Carlini <paolo.carlini@oracle.com> PR c++/57947 * call.c (is_std_init_list): Return false if cxx_dialect == cxx98. /testsuite 2013-07-30 Paolo Carlini <paolo.carlini@oracle.com> PR c++/57947 * g++.dg/parse/crash63.C: New.