2010-03-22 Jason Merrill <jason@redhat.com>
+ PR c++/43333
+ * tree.c (pod_type_p): Use old meaning in C++98 mode.
+
PR c++/43281
* pt.c (contains_auto_r): New fn.
(do_auto_deduction): Use it.
argument unmodified and we assign it to a const_tree. */
t = strip_array_types (CONST_CAST_TREE(t));
- if (CLASS_TYPE_P (t))
+ if (!CLASS_TYPE_P (t))
+ return scalarish_type_p (t);
+ else if (cxx_dialect > cxx98)
/* [class]/10: A POD struct is a class that is both a trivial class and a
standard-layout class, and has no non-static data members of type
non-POD struct, non-POD union (or array of such types).
non-std-layout or non-trivial, the class will be too. */
return (std_layout_type_p (t) && trivial_type_p (t));
else
- return scalarish_type_p (t);
+ /* The C++98 definition of POD is different. */
+ return !CLASSTYPE_NON_LAYOUT_POD_P (t);
}
/* Returns true iff T is POD for the purpose of layout, as defined in the
2010-03-22 Jason Merrill <jason@redhat.com>
+ PR c++/43333
+ * g++.dg/ext/is_pod.C: Pass -std=c++0x.
+ * g++.dg/ext/is_pod_98.C: New.
+
PR c++/43281
* g++.dg/cpp0x/auto18.C: New.
--- /dev/null
+// PR c++/43333
+// { dg-options "-std=c++98" }
+// { dg-do run }
+
+struct strPOD
+{
+ const char *const foo;
+ const char *const bar;
+};
+extern "C" void abort (void);
+int main ()
+{
+ if (!__is_pod (strPOD))
+ abort ();
+ return 0;
+}