Commit 565839ae by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/59268 ([c++11] ICE with constexpr in a virtual function)

	PR c++/59268
	* pt.c (tsubst_copy_and_build): Handle POINTER_PLUS_EXPR.

	* g++.dg/cpp0x/constexpr-template6.C: New test.

From-SVN: r205674
parent 3bd7b086
2013-12-04 Jakub Jelinek <jakub@redhat.com>
PR c++/59268
* pt.c (tsubst_copy_and_build): Handle POINTER_PLUS_EXPR.
2013-11-29 Marek Polacek <polacek@redhat.com>
PR sanitizer/59331
......
......@@ -14159,6 +14159,10 @@ tsubst_copy_and_build (tree t,
RETURN (r);
}
case POINTER_PLUS_EXPR:
return fold_build_pointer_plus (RECUR (TREE_OPERAND (t, 0)),
RECUR (TREE_OPERAND (t, 1)));
case SCOPE_REF:
RETURN (tsubst_qualified_id (t, args, complain, in_decl, /*done=*/true,
/*address_p=*/false));
......
2013-12-04 Jakub Jelinek <jakub@redhat.com>
PR c++/59268
* g++.dg/cpp0x/constexpr-template6.C: New test.
2013-12-04 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/pack19.adb: New test.
......
// PR c++/59268
// { dg-do compile }
// { dg-options "-std=c++11" }
template <typename>
struct A
{
constexpr A (int) {}
virtual void foo ()
{
constexpr A<void> a (0);
}
};
void
bar ()
{
A<int> a (3);
a.foo ();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment