aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2016-04-12 16:24:11 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2016-04-12 16:24:11 +0000
commitd4619dc11e4ee5177053a2e8aae5f259ad3546f8 (patch)
treeeeccf8928eb09e1d412faff407e06590eb08e9f0
parent4f93efa4c5ff82833445df1505dc8cd89e2ffb09 (diff)
downloadgcc-d4619dc11e4ee5177053a2e8aae5f259ad3546f8.zip
gcc-d4619dc11e4ee5177053a2e8aae5f259ad3546f8.tar.gz
gcc-d4619dc11e4ee5177053a2e8aae5f259ad3546f8.tar.bz2
re PR c++/70501 (internal compiler error: in verify_ctor_sanity, at cp/constexpr.c:2249)
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
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/constexpr.c6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/init/pr70501.C11
4 files changed, 25 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index d1f1851..ee830a2 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c
index e6e2cf6..13f385b 100644
--- a/gcc/cp/constexpr.c
+++ b/gcc/cp/constexpr.c
@@ -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;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 64753aa..1c2b5a7 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 0000000..901b3c1
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/pr70501.C
@@ -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)} };
+}