tree-ssa-loop-im.c (gen_lsm_tmp_name): Fix bogus fallthru.
[gcc.git] / gcc / testsuite / g++.dg / template / error45.C
1 // Contributed by Dodji Seketeli <dodji@redhat.com>
2 // Origin PR c++/42634
3 // { dg-options "-g -std=gnu++0x" }
4 // { dg-do compile }
5
6 template<typename T> T declval();
7
8 template<typename T, typename... Args> struct is_constructible {
9 template<typename T1, typename... Args1> static decltype(T1(declval<Args1>()...), char()) test();
10 static const bool value = sizeof(test<T, Args...>()) == 1;
11 };
12 template<bool> struct enable_if {
13 typedef void type;
14 };
15 template<class T1, class T2> struct pair {
16 template<class U2,
17 class = typename enable_if<is_constructible<T2,U2&&>::value>::type
18 >
19 pair(const T1&, U2&&) { }
20 };
21 struct string {
22 string() : p(0) {}
23 char* p;
24 };
25
26 struct Foo {
27 string s;
28 int i;
29 };
30
31 void f()
32 {
33 pair<int, Foo>(1, Foo());
34 }
35