1 // PR c++/48324
2 // { dg-do compile { target c++11 } }
3 
4 struct S {
5   const int val;
SS6   constexpr S(int i) : val(i) { }
7 };
8 
to_ref(int i)9 constexpr const int& to_ref(int i) {
10   return S(i).val; // { dg-warning "reference to temporary" }
11 }
12 
13 constexpr int ary[to_ref(98)] = { }; // { dg-error "not an integral" }
14