+2017-01-20 Nathan Sidwell <nathan@acm.org>
+
+ PR c++/78495 - wrong code inherited ctor and invisi-ref parm
+ * cp-gimplify.c (cp_generize_r): Don't skip thunks.
+
2017-01-20 David Malcolm <dmalcolm@redhat.com>
PR c++/77829
&& omp_var_to_track (stmt))
omp_cxx_notice_variable (wtd->omp_ctx, stmt);
- /* Don't dereference parms in a thunk, pass the references through. */
- if ((TREE_CODE (stmt) == CALL_EXPR && CALL_FROM_THUNK_P (stmt))
- || (TREE_CODE (stmt) == AGGR_INIT_EXPR && AGGR_INIT_FROM_THUNK_P (stmt)))
- {
- *walk_subtrees = 0;
- return NULL;
- }
-
- /* Otherwise, do dereference invisible reference parms. */
+ /* Dereference invisible reference parms. */
if (wtd->handle_invisiref_parm_p && is_invisiref_parm (stmt))
{
*stmt_p = convert_from_reference (stmt);
+2017-01-20 Nathan Sidwell <nathan@acm.org>
+
+ PR c++/79495
+ * g++.dg/cpp1z/inh-ctor38.C: New.
+
2017-01-20 Marek Polacek <polacek@redhat.com>
PR c/79152
--- /dev/null
+// { dg-do run { target c++11 } }
+// PR78495 failed to propagate pass-by-value struct to base ctor.
+
+struct Ptr {
+ void *ptr = 0;
+
+ Ptr() {}
+ Ptr(Ptr const&) = delete;
+ Ptr(Ptr&& other) : ptr (other.ptr) {}
+};
+
+struct Base {
+ Ptr val;
+ Base(Ptr val_) : val(static_cast<Ptr&&>(val_)) {}
+};
+
+struct Derived: Base {
+ using Base::Base;
+};
+
+void *Foo () {
+ Ptr ptr;
+
+ Derived d(static_cast<Ptr&&>(ptr));
+
+ return d.val.ptr;
+}
+
+int main () {
+ return Foo () != 0;
+}