annotate gcc/testsuite/g++.dg/cpp1y/auto-fn27.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++/66919
kono
parents:
diff changeset
2 // { dg-do compile { target c++14 } }
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 template <int>
kono
parents:
diff changeset
5 struct A {
kono
parents:
diff changeset
6 template <typename F, typename R, typename T>
kono
parents:
diff changeset
7 static auto run (F fn, R, T) { auto r = fn (); } // { dg-error "" }
kono
parents:
diff changeset
8 };
kono
parents:
diff changeset
9 template <typename F, typename T>
kono
parents:
diff changeset
10 auto foo (F fn, T)
kono
parents:
diff changeset
11 {
kono
parents:
diff changeset
12 A <0>::run (fn, 0, 0);
kono
parents:
diff changeset
13 }
kono
parents:
diff changeset
14 struct B;
kono
parents:
diff changeset
15 struct C {
kono
parents:
diff changeset
16 typedef B D;
kono
parents:
diff changeset
17 };
kono
parents:
diff changeset
18 struct E {
kono
parents:
diff changeset
19 virtual void bar (const int &);
kono
parents:
diff changeset
20 };
kono
parents:
diff changeset
21 template <typename C>
kono
parents:
diff changeset
22 struct F : E {
kono
parents:
diff changeset
23 typedef typename C::D::G G;
kono
parents:
diff changeset
24 void bar (const G &);
kono
parents:
diff changeset
25 typename C::D::H I;
kono
parents:
diff changeset
26 };
kono
parents:
diff changeset
27 struct J { struct K {}; };
kono
parents:
diff changeset
28 template <typename T>
kono
parents:
diff changeset
29 void
kono
parents:
diff changeset
30 F<T>::bar (const G &)
kono
parents:
diff changeset
31 {
kono
parents:
diff changeset
32 auto s = I;
kono
parents:
diff changeset
33 typedef decltype (s) L;
kono
parents:
diff changeset
34 auto u =[&](L) { auto t = foo (J::K (), 0); }; // { dg-error "25:declared void" }
kono
parents:
diff changeset
35 }
kono
parents:
diff changeset
36 struct B {
kono
parents:
diff changeset
37 typedef int G;
kono
parents:
diff changeset
38 typedef int H;
kono
parents:
diff changeset
39 };
kono
parents:
diff changeset
40 struct M : F <C> {
kono
parents:
diff changeset
41 M () {}
kono
parents:
diff changeset
42 };