+2020-01-24 Jason Merrill <jason@redhat.com>
+
+ PR c++/92852 - ICE with generic lambda and reference var.
+ * constexpr.c (maybe_constant_value): Likewise.
+
2020-01-23 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/92804
if (cv_cache == NULL)
cv_cache = hash_map<tree, tree>::create_ggc (101);
if (tree *cached = cv_cache->get (t))
- return *cached;
+ return unshare_expr_without_location (*cached);
r = cxx_eval_outermost_constant_expr (t, true, true, false, false, decl);
gcc_checking_assert (r == t
--- /dev/null
+// PR c++/92852
+// { dg-do compile { target c++14 } }
+
+struct S { int operator<<(const int &); } glob;
+void foo()
+{
+ S& message_stream = glob;
+ auto format = [&message_stream](auto && x)
+ { message_stream << x ; };
+ format(3);
+ format(4u);
+}
{
S v {1, 2};
auto& [s, t] = v; // { dg-warning "structured bindings only available with" "" { target c++14_down } }
- return s; // { dg-warning "reference to local variable 'v' returned" "" { target *-*-* } .-1 }
+ return s; // { dg-warning "reference to local variable 'v' returned" }
}
int &
{
int a[3] = {1, 2, 3};
auto& [s, t, u] = a; // { dg-warning "structured bindings only available with" "" { target c++14_down } }
- return s; // { dg-warning "reference to local variable 'a' returned" "" { target *-*-* } .-1 }
+ return s; // { dg-warning "reference to local variable 'a' returned" }
}
int &
{
S v {1, 2};
auto& [s, t] = v; // { dg-warning "structured bindings only available with" "" { target c++14_down } }
- return &s; // { dg-warning "address of local variable 'v' returned" "" { target *-*-* } .-1 }
+ return &s; // { dg-warning "address of local variable 'v' returned" }
}
int *
{
int a[3] = {1, 2, 3};
auto& [s, t, u] = a; // { dg-warning "structured bindings only available with" "" { target c++14_down } }
- return &s; // { dg-warning "address of local variable 'a' returned" "" { target *-*-* } .-1 }
+ return &s; // { dg-warning "address of local variable 'a' returned" }
}
int *