blob: b09d9215310d6ca8f86a177592ffe23561096271 [file] [log] [blame]
// PR c++/986
// { dg-options "-Wall -Wextra" }
struct X { X (int); };
struct Y {
Y ();
const X &x; // note the ampersand
};
Y::Y () : x(1) {} // { dg-warning "temporary" }
/* The initialization of x with the temporary might also trigger:
{ dg-prune-output "-Wdangling-pointer" } */