commit f7a5840c46397ad2e75b9f3a47219d697a75bccf
Author: Jason Merrill <jason@redhat.com>
Date: Sun Jul 4 09:57:42 2010 -0400
PR c++/44703
* call.c (is_std_init_list): Look through typedefs.
@@ -7953,6 +7953,10 @@ initialize_reference (tree type, tree expr, tree decl, tree *cleanup,
bool
is_std_init_list (tree type)
{
+ /* Look through typedefs. */
+ if (!TYPE_P (type))
+ return false;
+ type = TYPE_MAIN_VARIANT (type);
return (CLASS_TYPE_P (type)
&& CP_TYPE_CONTEXT (type) == std_node
&& strcmp (TYPE_NAME_STRING (type), "initializer_list") == 0);
new file mode 100644
@@ -0,0 +1,14 @@
+// PR c++/44703
+// { dg-options -std=c++0x }
+
+#include <initializer_list>
+
+typedef std::initializer_list<int> type ;
+void f(type) {}
+
+int main()
+{
+// error: could not convert '{1, 2, 3}' to 'type'
+ f({1,2,3}) ;
+}
+