+2020-03-24 Jason Merrill <jason@redhat.com>
+
+ * cp-tree.h (cp_expr): When constructing from an expr and a
+ location, call protected_set_expr_location.
+
2020-03-23 Patrick Palka <ppalka@redhat.com>
PR c++/93805
m_value (value), m_loc (cp_expr_location (m_value)) {}
cp_expr (tree value, location_t loc):
- m_value (value), m_loc (loc) {}
+ m_value (value), m_loc (loc)
+ {
+ protected_set_expr_location (value, loc);
+ }
/* Implicit conversions to tree. */
operator tree () const { return m_value; }
void foo()
{
int x[({ return; })]; // { dg-error "could not convert" }
-// { dg-error "12:size of array .x. has non-integral" "" { target *-*-* } .-1 }
+// { dg-error "9:size of array .x. has non-integral" "" { target *-*-* } .-1 }
}
void foo()
{
if (({int c[2];})) ; // { dg-error "7:ISO C.. forbids" "7" }
- // { dg-error "17:could not convert" "17" { target *-*-* } .-1 }
+ // { dg-error "7:could not convert" "17" { target *-*-* } .-1 }
}
void bar()
// We expect a warning at the declaration of construct2, since Automatic2 is
// defined below; we don't expect one for construct1, because Automatic1 is
// defined in the fake system header.
-// { dg-warning "noexcept-expression" "" { target *-*-* } 15 }
+// { dg-warning "noexcept-expression" "" { target *-*-* } 16 }
class Automatic2 {
public: