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
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.
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.
--- /dev/null
+// PR c++/84445
+// { dg-do compile }
+
+struct A { virtual void foo (); };
+
+void
+bar (A *p)
+{
+ __builtin_launder (p)->foo ();
+}