annotate gcc/testsuite/g++.dg/cpp0x/rv-return.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 // PR c++/41815
kono
parents:
diff changeset
2 // { dg-do compile { target c++11 } }
kono
parents:
diff changeset
3 // { dg-options "-fno-ipa-icf" }
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 template<typename T, typename U> struct same_type;
kono
parents:
diff changeset
6 template<typename T> struct same_type<T, T> {};
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 int const f() { return 0; }
kono
parents:
diff changeset
9
kono
parents:
diff changeset
10 int &&r = f(); // binding "int&&" to "int" should succeed
kono
parents:
diff changeset
11 same_type<decltype(f()), int> s1;
kono
parents:
diff changeset
12 same_type<decltype(0,f()), int> s2;
kono
parents:
diff changeset
13
kono
parents:
diff changeset
14 template <class T>
kono
parents:
diff changeset
15 T const g() { return 0; }
kono
parents:
diff changeset
16
kono
parents:
diff changeset
17 int &&r2 = g<int>();
kono
parents:
diff changeset
18 same_type<decltype(g<int>()), int> s3;
kono
parents:
diff changeset
19 same_type<decltype(0,g<int>()), int> s4;