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
This commit is contained in:
Nathan Sidwell 2016-04-12 16:24:11 +00:00 committed by Nathan Sidwell
parent 4f93efa4c5
commit d4619dc11e
4 changed files with 25 additions and 3 deletions

View 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

View 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;

View 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.

View File

@ -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)} };
}