OSDN Git Service

/cp
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 17 Jul 2008 09:11:11 +0000 (09:11 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 17 Jul 2008 09:11:11 +0000 (09:11 +0000)
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).

/testsuite
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@137914 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/has_trivial_destructor-1.C [moved from gcc/testsuite/g++.dg/ext/has_trivial_destructor.C with 100% similarity]
gcc/testsuite/g++.dg/ext/has_trivial_destructor-2.C [new file with mode: 0644]

index 8f87551..0e537b8 100644 (file)
@@ -1,8 +1,13 @@
+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.
 
@@ -22,8 +27,8 @@
 
        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>
 
index 17b1e5d..d2f56ea 100644 (file)
@@ -4730,7 +4730,7 @@ trait_expr_value (cp_trait_kind kind, tree type1, tree type2)
 
     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)));
 
index ec7dc05..528a111 100644 (file)
@@ -1,3 +1,10 @@
+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
diff --git a/gcc/testsuite/g++.dg/ext/has_trivial_destructor-2.C b/gcc/testsuite/g++.dg/ext/has_trivial_destructor-2.C
new file mode 100644 (file)
index 0000000..f9dacf1
--- /dev/null
@@ -0,0 +1,3 @@
+// PR c++/36855
+
+typedef char assert_0 [__has_trivial_destructor (int&) ? 1 : -1];