repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
PR c++/86728 - C variadic generic lambda.
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
cpp0x
/
pr51547.C
blob
578a799e7f84e5983092dbd903f751c6ee22d8a4
1
// PR c++/51547
2
// { dg-do compile { target c++11 } }
3
4
template <class T>
5
struct vector
6
{
7
T*
8
begin()
9
{ return &member; }
10
11
const T*
12
begin() const
13
{ return &member; }
14
15
T member;
16
};
17
18
struct Bar {
19
int x;
20
};
21
22
struct Foo {
23
const vector<Bar>& bar() const {
24
return bar_;
25
}
26
27
vector<Bar> bar_;
28
};
29
30
template <class X>
31
struct Y {
32
void foo() {
33
Foo a;
34
auto b = a.bar().begin();
35
auto&& c = b->x;
36
}
37
};
38
39
template <class X>
40
void foo() {
41
Foo a;
42
auto b = a.bar().begin();
43
auto&& c = b->x;
44
}
45
46
int main() {
47
Y<int> p;
48
p.foo();
49
foo<int>();
50
}