OSDN Git Service

* parser.c (cp_parser_class_specifier): Set class location to that
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / template / sfinae16.C
1 // PR c++/41927
2 // { dg-options "-std=c++0x -Wall" }
3
4 // We were getting a spurious ||/&& warning about the enable_if with the
5 // source position of d1.
6
7 template<typename Tp>
8   struct is_int
9   { static const bool value = true; };
10
11 template<bool, typename Tp = void>
12   struct enable_if
13   { };
14
15 template<typename Tp>
16   struct enable_if<true, Tp>
17   { typedef Tp type; };
18
19 template<typename Rep>
20   struct duration
21   {
22     duration() { }
23
24     template<typename Rep2, typename = typename
25              enable_if<false || (true && is_int<Rep2>::value)>::type>
26     duration(const duration<Rep2>&) { }
27   };
28
29 int main()
30 {
31   duration<int> d0;
32   duration<int> d1 = d0;        // { dg-warning "set but not used" }
33 }
34