+2008-07-21 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/36870
+ * semantics.c (classtype_has_nothrow_assign_or_copy_p): Use
+ TYPE_NOTHROW_P, not TREE_NOTHROW.
+ (trait_expr_value): Likewise.
+
2008-07-18 Dodji Seketeli <dseketel@redhat.com>
PR c++/36407
return false;
for (; fns; fns = OVL_NEXT (fns))
- if (!TREE_NOTHROW (OVL_CURRENT (fns)))
+ if (!TYPE_NOTHROW_P (TREE_TYPE (OVL_CURRENT (fns))))
return false;
return true;
type1 = strip_array_types (type1);
return (trait_expr_value (CPTK_HAS_TRIVIAL_CONSTRUCTOR, type1, type2)
|| (CLASS_TYPE_P (type1)
- && (t = locate_ctor (type1, NULL)) && TREE_NOTHROW (t)));
+ && (t = locate_ctor (type1, NULL))
+ && TYPE_NOTHROW_P (TREE_TYPE (t))));
case CPTK_HAS_TRIVIAL_CONSTRUCTOR:
type1 = strip_array_types (type1);
+2008-07-21 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/36870
+ * g++.dg/ext/has_nothrow_assign_odr.C: New.
+ * g++.dg/ext/has_nothrow_copy_odr.C: Likewise.
+ * g++.dg/ext/has_nothrow_constructor_odr.C: Likewise.
+ * g++.dg/ext/has_nothrow_assign.C: Adjust.
+ * g++.dg/ext/has_nothrow_copy.C: Likewise.
+ * g++.dg/ext/has_nothrow_constructor.C: Likewise.
+
2008-07-17 Andreas Krebbel <krebbel1@de.ibm.com>
PR target/36822
assert (PTEST (C));
assert (NTEST (C[]));
assert (PTEST (D));
-#ifndef __PIC__
- assert (PTEST (E));
-#endif
+ assert (NTEST (E));
assert (NTEST (E1));
assert (PTEST (F));
assert (PTEST (G));
-#ifndef __PIC__
- assert (PTEST (H));
-#endif
+ assert (NTEST (H));
assert (NTEST (H1));
-#ifndef __PIC__
- assert (PTEST (I));
-#endif
+ assert (NTEST (I));
assert (NTEST (I1));
assert (PTEST (J));
assert (NTEST (const K));
--- /dev/null
+// PR c++/36870
+// { dg-do "run" }
+#include <cassert>
+
+struct S { const S& operator= (const S&); };
+
+bool f ();
+
+int main ()
+{
+ assert (__has_nothrow_assign (S) == f ());
+}
+
+const S& S::operator= (const S&) { }
+
+bool f () { return __has_nothrow_assign (S); }
assert (PTEST (C));
assert (PTEST (C[]));
assert (PTEST (D));
-#ifndef __PIC__
- assert (PTEST (E));
-#endif
+ assert (NTEST (E));
assert (NTEST (E1));
assert (NTEST (F));
assert (NTEST (G));
--- /dev/null
+// PR c++/36870
+// { dg-do "run" }
+#include <cassert>
+
+struct S { S (); };
+
+bool f ();
+
+int main ()
+{
+ assert (__has_nothrow_constructor (S) == f ());
+}
+
+S::S () { }
+
+bool f () { return __has_nothrow_constructor (S); }
assert (PTEST (C));
assert (NTEST (C[]));
assert (PTEST (D));
-#ifndef __PIC__
- assert (PTEST (E));
-#endif
+ assert (NTEST (E));
assert (NTEST (E1));
assert (PTEST (F));
assert (PTEST (G));
-#ifndef __PIC__
- assert (PTEST (H));
-#endif
+ assert (NTEST (H));
assert (NTEST (H1));
-#ifndef __PIC__
- assert (PTEST (I));
-#endif
+ assert (NTEST (I));
assert (NTEST (I1));
assert (PTEST (J));
--- /dev/null
+// PR c++/36870
+// { dg-do "run" }
+#include <cassert>
+
+struct S { S (const S&); };
+
+bool f ();
+
+int main ()
+{
+ assert (__has_nothrow_copy (S) == f ());
+}
+
+S::S (const S&) { }
+
+bool f () { return __has_nothrow_copy (S); }