aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPaolo Carlini <paolo@gcc.gnu.org>2008-07-17 09:11:11 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2008-07-17 09:11:11 +0000
commitafb86620e1ae16abdde90ccca6e106472ef6d70d (patch)
treedc4d9a5e45e100a882c0f61e398daa1470f6e4a8 /gcc
parentb08c51086fceec9cd27858dae48bf55fbbfccc1c (diff)
downloadgcc-afb86620e1ae16abdde90ccca6e106472ef6d70d.zip
gcc-afb86620e1ae16abdde90ccca6e106472ef6d70d.tar.gz
gcc-afb86620e1ae16abdde90ccca6e106472ef6d70d.tar.bz2
re PR c++/36855 (__has_trivial_destructor() returns false for reference types.)
/cp 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. From-SVN: r137914
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog13
-rw-r--r--gcc/cp/semantics.c2
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/g++.dg/ext/has_trivial_destructor-1.C (renamed from gcc/testsuite/g++.dg/ext/has_trivial_destructor.C)0
-rw-r--r--gcc/testsuite/g++.dg/ext/has_trivial_destructor-2.C3
5 files changed, 20 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 8f87551..0e537b8 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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>
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 17b1e5d..d2f56ea 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -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)));
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index ec7dc05..528a111 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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.C b/gcc/testsuite/g++.dg/ext/has_trivial_destructor-1.C
index 719f05f..719f05f 100644
--- a/gcc/testsuite/g++.dg/ext/has_trivial_destructor.C
+++ b/gcc/testsuite/g++.dg/ext/has_trivial_destructor-1.C
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
index 0000000..f9dacf1
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/has_trivial_destructor-2.C
@@ -0,0 +1,3 @@
+// PR c++/36855
+
+typedef char assert_0 [__has_trivial_destructor (int&) ? 1 : -1];