Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/g++.dg/cpp1y/auto-fn6.C @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
line wrap: on
line source
// { dg-do compile { target c++14 } } template <class T, class U> struct ST; template <class T> struct ST<T,T> {}; int g(int); char& g(char); double&& g(double); template <class T> auto&& f(T t) { return g(t); } // { dg-warning "reference to temporary" } int main() { ST<decltype(f(1)),int&&>(); ST<decltype(f('\0')),char&>(); ST<decltype(f(1.0)),double&&>(); }