* call.c (is_std_init_list): Look through typedefs.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161880
138bc75d-0d04-0410-961f-
82ee72b054a4
2010-07-06 Jason Merrill <jason@redhat.com>
+ PR c++/44703
+ * call.c (is_std_init_list): Look through typedefs.
+
PR c++/44778
* init.c (build_offset_ref): If scope isn't dependent,
don't exit early. Look at TYPE_MAIN_VARIANT.
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);
2010-07-06 Jason Merrill <jason@redhat.com>
+ PR c++/44703
+ * g++.dg/cpp0x/initlist41.C: New.
+
PR c++/44778
* g++.dg/template/ptrmem22.C: New.
--- /dev/null
+// 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}) ;
+}
+