aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/error4.C
blob: bd73b2a766cad4e22a96536d06d1e7102b638dd3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// PR c++/49156
// { dg-do compile { target c++11 } }

template<typename T> T declval();

template<typename T>
struct S {

  template<typename U>
    static U get(const volatile T&);

  template<typename U>
    static decltype(*declval<U>()) get(...); // { dg-error "operator*" }

  typedef decltype(get<T>(declval<T>())) type; // { dg-error "no match" }
};

struct X { };

S<X>::type x;

// { dg-prune-output "note" }