+2008-07-17 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/36855
+ * semantics.c (trait_expr_value): Update __has_trivial_destructor
+ semantics to the current WP (N2691).
+
2008-07-16 Dodji Seketeli <dseketel@redhat.com>
PR c++/13699
- * gcc/cp/name-lookup.c (lookup_extern_c_fun_binding_in_all_ns):
- New function.
+ * name-lookup.c (lookup_extern_c_fun_binding_in_all_ns): New function.
(pushdecl_maybe_friend): Check if a redeclaration of extern C function
complies with exception specification constraints.
PR c++/13101
* decl.c (grokdeclarator): Warn about initializing variables
- of storage class 'extern' only after the type of the declarator
- has been properly computed.
+ of storage class 'extern' only after the type of the declarator
+ has been properly computed.
2008-07-11 Dodji Seketeli <dseketel@redhat.com>
case CPTK_HAS_TRIVIAL_DESTRUCTOR:
type1 = strip_array_types (type1);
- return (pod_type_p (type1)
+ return (pod_type_p (type1) || type_code1 == REFERENCE_TYPE
|| (CLASS_TYPE_P (type1)
&& TYPE_HAS_TRIVIAL_DESTRUCTOR (type1)));
+2008-07-17 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/36855
+ * g++.dg/ext/has_trivial_destructor.C: Rename to...
+ * g++.dg/ext/has_trivial_destructor-1.C: ... this.
+ * g++.dg/ext/has_trivial_destructor-2.C: New.
+
2008-07-17 Paolo Bonzini <bonzini@gnu.org>
PR rtl-optimization/36753
--- /dev/null
+// { dg-do "run" }
+#include <cassert>
+
+struct A
+{
+ double a;
+ double b;
+};
+
+union U
+{
+ double a;
+ double b;
+};
+
+struct B
+{
+ ~B() { }
+};
+
+struct C
+: public B { };
+
+struct D
+: public A { };
+
+template<typename T>
+ bool
+ f()
+ { return __has_trivial_destructor(T); }
+
+template<typename T>
+ class My
+ {
+ public:
+ bool
+ f()
+ { return !!__has_trivial_destructor(T); }
+ };
+
+template<typename T>
+ class My2
+ {
+ public:
+ static const bool trait = __has_trivial_destructor(T);
+ };
+
+template<typename T>
+ const bool My2<T>::trait;
+
+template<typename T, bool b = __has_trivial_destructor(T)>
+ struct My3_help
+ { static const bool trait = b; };
+
+template<typename T, bool b>
+ const bool My3_help<T, b>::trait;
+
+template<typename T>
+ class My3
+ {
+ public:
+ bool
+ f()
+ { return My3_help<T>::trait; }
+ };
+
+#define PTEST(T) (__has_trivial_destructor(T) && f<T>() \
+ && My<T>().f() && My2<T>::trait && My3<T>().f())
+
+#define NTEST(T) (!__has_trivial_destructor(T) && !f<T>() \
+ && !My<T>().f() && !My2<T>::trait && !My3<T>().f())
+
+int main()
+{
+ assert (PTEST (int));
+ assert (NTEST (int (int)));
+ assert (NTEST (void));
+ assert (PTEST (A));
+ assert (PTEST (U));
+ assert (NTEST (B));
+ assert (NTEST (C));
+ assert (PTEST (D));
+ assert (PTEST (D[]));
+
+ return 0;
+}
--- /dev/null
+// PR c++/36855
+
+typedef char assert_0 [__has_trivial_destructor (int&) ? 1 : -1];
+++ /dev/null
-// { dg-do "run" }
-#include <cassert>
-
-struct A
-{
- double a;
- double b;
-};
-
-union U
-{
- double a;
- double b;
-};
-
-struct B
-{
- ~B() { }
-};
-
-struct C
-: public B { };
-
-struct D
-: public A { };
-
-template<typename T>
- bool
- f()
- { return __has_trivial_destructor(T); }
-
-template<typename T>
- class My
- {
- public:
- bool
- f()
- { return !!__has_trivial_destructor(T); }
- };
-
-template<typename T>
- class My2
- {
- public:
- static const bool trait = __has_trivial_destructor(T);
- };
-
-template<typename T>
- const bool My2<T>::trait;
-
-template<typename T, bool b = __has_trivial_destructor(T)>
- struct My3_help
- { static const bool trait = b; };
-
-template<typename T, bool b>
- const bool My3_help<T, b>::trait;
-
-template<typename T>
- class My3
- {
- public:
- bool
- f()
- { return My3_help<T>::trait; }
- };
-
-#define PTEST(T) (__has_trivial_destructor(T) && f<T>() \
- && My<T>().f() && My2<T>::trait && My3<T>().f())
-
-#define NTEST(T) (!__has_trivial_destructor(T) && !f<T>() \
- && !My<T>().f() && !My2<T>::trait && !My3<T>().f())
-
-int main()
-{
- assert (PTEST (int));
- assert (NTEST (int (int)));
- assert (NTEST (void));
- assert (PTEST (A));
- assert (PTEST (U));
- assert (NTEST (B));
- assert (NTEST (C));
- assert (PTEST (D));
- assert (PTEST (D[]));
-
- return 0;
-}