]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/70501 (internal compiler error: in verify_ctor_sanity, at cp/constexpr...
authorNathan Sidwell <nathan@acm.org>
Tue, 12 Apr 2016 16:24:11 +0000 (16:24 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Tue, 12 Apr 2016 16:24:11 +0000 (16:24 +0000)
PR c++/70501

cp/
* constexpr.c (cxx_eval_bare_aggregate): Handle VECTOR_TYPE
similarly to PMF.

testsuite/
* g++.dg/init/pr70501.C: New.

From-SVN: r234904

gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/init/pr70501.C [new file with mode: 0644]

index d1f1851d57661726d5016bc950920f56d890dc0d..ee830a2e7e492fe415afdfd59919e5d63dfc2b97 100644 (file)
@@ -1,3 +1,9 @@
+2016-04-12  Nathan Sidwell  <nathan@acm.org>
+
+       PR c++/70501
+       * constexpr.c (cxx_eval_bare_aggregate): Handle VECTOR_TYPE
+       similarly to PMF.
+
 2016-04-11  Jason Merrill  <jason@redhat.com>
 
        * mangle.c (decl_is_template_id): The template itself counts as a
index e6e2cf6ca5f05053ea8c5f33a2831de1712e4619..13f385b5a19447f28872e5b7e9cf39cf2184d5d9 100644 (file)
@@ -2394,10 +2394,10 @@ cxx_eval_bare_aggregate (const constexpr_ctx *ctx, tree t,
   tree type = TREE_TYPE (t);
 
   constexpr_ctx new_ctx;
-  if (TYPE_PTRMEMFUNC_P (type))
+  if (TYPE_PTRMEMFUNC_P (type) || VECTOR_TYPE_P (type))
     {
-      /* We don't really need the ctx->ctor business for a PMF, but it's
-        simpler to use the same code.  */
+      /* We don't really need the ctx->ctor business for a PMF or
+        vector, but it's simpler to use the same code.  */
       new_ctx = *ctx;
       new_ctx.ctor = build_constructor (type, NULL);
       new_ctx.object = NULL_TREE;
index 64753aa4e32371ddb1f2fd4504647b6aa2ba8ea7..1c2b5a76159accd4862224e66f92356705f77ad0 100644 (file)
@@ -1,3 +1,8 @@
+2016-04-12  Nathan Sidwell  <nathan@acm.org>
+
+       PR c++/70501
+       * g++.dg/init/pr70501.C: New.
+
 2016-04-12  David Wohlferd  <dw@LimeGreenSocks.com>
 
        * gcc.target/i386/asm-flag-6.c: New test.
diff --git a/gcc/testsuite/g++.dg/init/pr70501.C b/gcc/testsuite/g++.dg/init/pr70501.C
new file mode 100644 (file)
index 0000000..901b3c1
--- /dev/null
@@ -0,0 +1,11 @@
+/* { dg-options "" } Not pedantic */
+
+typedef int v4si __attribute__ ((vector_size (16)));
+
+struct S { v4si v; };
+
+void
+fn2 (int i, int j)
+{
+  struct S s = { .v = i <= j + (v4si){(1, 2)} };
+}