blob: f89eb07b5a1a516f9d64a63a929ffd8bde1a08cb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
// PR c++/80767
// { dg-do compile { target c++17 } }
template <typename... Fs>
struct overloader : Fs...
{
overloader(Fs... fs)
: Fs(fs)...
{ }
using Fs::operator()...;
};
struct a { void foo() { } };
struct b { void bar() { } };
struct c { void bar() { } };
int main() {
overloader{
[](a x) { x.foo(); },
[](auto x) { x.bar(); }
}(a{});
}
|