]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
pt.c (tsubst_copy_and_build): Handle VECTOR_TYPE like scalars.
authorMarc Glisse <marc.glisse@inria.fr>
Fri, 3 Aug 2012 12:00:43 +0000 (14:00 +0200)
committerMarc Glisse <glisse@gcc.gnu.org>
Fri, 3 Aug 2012 12:00:43 +0000 (12:00 +0000)
gcc/cp/ChangeLog
2012-08-03  Marc Glisse  <marc.glisse@inria.fr>

* pt.c (tsubst_copy_and_build): Handle VECTOR_TYPE like scalars.
* cp-tree.h (scalarish_type_p): Declare.
* tree.c (scalarish_type_p): Make non-static.

gcc/testsuite/ChangeLog
2012-08-03  Marc Glisse  <marc.glisse@inria.fr>

* g++.dg/ext/vector17.C: New testcase.

From-SVN: r190123

gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/pt.c
gcc/cp/tree.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/vector17.C [new file with mode: 0644]

index 92c9db1a99e2c5eecb1a29ed8da1db26efa67707..f57769dc2faa724fe6d090ea697f3249fc5797b0 100644 (file)
@@ -1,3 +1,9 @@
+2012-08-03  Marc Glisse  <marc.glisse@inria.fr>
+
+       * pt.c (tsubst_copy_and_build): Handle VECTOR_TYPE like scalars.
+       * cp-tree.h (scalarish_type_p): Declare.
+       * tree.c (scalarish_type_p): Make non-static.
+
 2012-08-02  Jason Merrill  <jason@redhat.com>
            Paolo Carlini  <paolo.carlini@oracle.com>
 
index e40f11482e7323a67fc2de05efaa6235f74c1ae6..44f3ac1d1c27523dda4a6c140147787bfed67eca 100644 (file)
@@ -5697,6 +5697,7 @@ extern bool layout_pod_type_p                     (const_tree);
 extern bool std_layout_type_p                  (const_tree);
 extern bool trivial_type_p                     (const_tree);
 extern bool trivially_copyable_p               (const_tree);
+extern bool scalarish_type_p                   (const_tree);
 extern bool type_has_nontrivial_default_init   (const_tree);
 extern bool type_has_nontrivial_copy_init      (const_tree);
 extern bool class_tmpl_impl_spec_p             (const_tree);
index 2ae576d7f18f636f44aebd12a9ad584dcafe9da1..ad81bab3c83f45a2508939661fafa258eebbc113 100644 (file)
@@ -13851,7 +13851,7 @@ tsubst_copy_and_build (tree t,
          /* We can't do much here.  */;
        else if (!CLASS_TYPE_P (object_type))
          {
-           if (SCALAR_TYPE_P (object_type))
+           if (scalarish_type_p (object_type))
              {
                tree s = NULL_TREE;
                tree dtor = member;
index 26e7fced793454cceaebc3cc7e6bd2fa3fcf729e..bfbde0460d6a776eaa032928935b8d4796d1a30f 100644 (file)
@@ -2818,7 +2818,7 @@ is_dummy_object (const_tree ob)
 /* Returns 1 iff type T is something we want to treat as a scalar type for
    the purpose of deciding whether it is trivial/POD/standard-layout.  */
 
-static bool
+bool
 scalarish_type_p (const_tree t)
 {
   if (t == error_mark_node)
index 78a829aaf26b6109dec7ac797837a91865f58c6f..cde4e40bc6c67a1b3aae848f5b18067b7b4eab1d 100644 (file)
@@ -1,3 +1,7 @@
+2012-08-03  Marc Glisse  <marc.glisse@inria.fr>
+
+       * g++.dg/ext/vector17.C: New testcase.
+
 2012-08-02  Richard Sandiford  <rdsandiford@googlemail.com>
 
        PR target/51931
diff --git a/gcc/testsuite/g++.dg/ext/vector17.C b/gcc/testsuite/g++.dg/ext/vector17.C
new file mode 100644 (file)
index 0000000..eb389be
--- /dev/null
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+typedef double __attribute__((vector_size(1024) )) vec;
+
+template <class T>
+void f (T *p)
+{
+  p->~T();
+}
+void g (vec *p)
+{
+  f(p);
+}