Commit 393d9df7 by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/84445 (ICE with __builtin_launder and virtual function)

	PR c++/84445
	* class.c (fixed_type_or_null) <case CALL_EXPR>: Only test
	TREE_HAS_CONSTRUCTOR if instance is not an internal function call.

	* g++.dg/cpp1z/launder7.C: New test.

From-SVN: r257840
parent 7f5753d7
2018-02-20 Jakub Jelinek <jakub@redhat.com>
PR c++/84445
* class.c (fixed_type_or_null) <case CALL_EXPR>: Only test
TREE_HAS_CONSTRUCTOR if instance is not an internal function call.
PR c++/84449
* tree.c (bot_manip): If build_cplus_new or break_out_target_exprs
returns error_mark_node, return it immediately.
......
......@@ -7128,7 +7128,8 @@ fixed_type_or_null (tree instance, int *nonnull, int *cdtorp)
case CALL_EXPR:
/* This is a call to a constructor, hence it's never zero. */
if (TREE_HAS_CONSTRUCTOR (instance))
if (CALL_EXPR_FN (instance)
&& TREE_HAS_CONSTRUCTOR (instance))
{
if (nonnull)
*nonnull = 1;
......
2018-02-20 Jakub Jelinek <jakub@redhat.com>
PR c++/84445
* g++.dg/cpp1z/launder7.C: New test.
PR c++/84449
* g++.dg/cpp0x/constexpr-84449.C: New test.
......
// PR c++/84445
// { dg-do compile }
struct A { virtual void foo (); };
void
bar (A *p)
{
__builtin_launder (p)->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