aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog3
-rw-r--r--gcc/cp/call.c4
-rw-r--r--gcc/testsuite/ChangeLog3
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/initlist41.C14
4 files changed, 24 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 499bd0d..8390f2a 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,8 @@
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.
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index c4f3e95..0bf7b8e 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -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);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index b840179..6fc6b3b 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,8 @@
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.
diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist41.C b/gcc/testsuite/g++.dg/cpp0x/initlist41.C
new file mode 100644
index 0000000..b538548
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/initlist41.C
@@ -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}) ;
+}
+