aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/expr.c1
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/nullptr23.C24
4 files changed, 35 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d0b662b..33fbaee 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2011-09-15 Jason Merrill <jason@redhat.com>
+
+ PR c++/50361
+ * expr.c (count_type_elements): Handle NULLPTR_TYPE.
+
2011-09-15 Jan Hubicka <jh@suse.cz>
* ipa-inline-analysis.c (add_condition): Add conditions parameter;
diff --git a/gcc/expr.c b/gcc/expr.c
index e4bb633..29bf68b 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -5296,6 +5296,7 @@ count_type_elements (const_tree type, bool for_ctor_p)
case POINTER_TYPE:
case OFFSET_TYPE:
case REFERENCE_TYPE:
+ case NULLPTR_TYPE:
return 1;
case ERROR_MARK:
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 71e748d..0bf6170 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2011-09-15 Jason Merrill <jason@redhat.com>
+
+ PR c++/50361
+ * g++.dg/cpp0x/nullptr23.C: New.
+
2011-09-15 Ira Rosen <ira.rosen@linaro.org>
* gcc.dg/vect/bb-slp-25.c: New.
diff --git a/gcc/testsuite/g++.dg/cpp0x/nullptr23.C b/gcc/testsuite/g++.dg/cpp0x/nullptr23.C
new file mode 100644
index 0000000..a078269
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/nullptr23.C
@@ -0,0 +1,24 @@
+// PR c++/50361
+// { dg-options -std=c++0x }
+
+#include <initializer_list>
+
+struct Foo
+{
+ Foo(std::initializer_list<Foo>) { };
+
+ template<class T> Foo(T t) { T u(t); };
+
+private:
+ union Data
+ {
+ Data() : null(nullptr) {}
+
+ std::nullptr_t null;
+ } u_;
+};
+
+int main()
+{
+ Foo f = { {} };
+}