1 // { dg-require-effective-target c++11 }
2 
3 template <class,class> struct ST;
4 template <class T> struct ST<T,T> {};
5 
6 struct A
7 {
8   int f() &;
9   char f() &&;
10 };
11 
12 template <class T> struct B
13 {
14   int f() &;
15   char f() &&;
16 };
17 
18 int main()
19 {
20   A a;
21   a.f();
22   A().f();
23   ST<decltype(a.f()), int>();
24   ST<decltype(A().f()), char>();
25   B<int> b;
26   b.f();
27   B<int>().f();
28   ST<decltype(b.f()), int>();
29   ST<decltype(B<int>().f()), char>();
30 }
31