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++/85765 - SFINAE and non-type default template arg.
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
cpp0x
/
range-for20.C
blob
eb3cfe7369920aa8b64623427aca96617d90bff3
1
// PR c++/49834
2
// PR c++/50020
3
// { dg-do compile { target c++11 } }
4
5
struct A
6
{
7
template <typename T> T get_value() const;
8
};
9
10
struct B {
11
A first, second;
12
};
13
14
struct C
15
{
16
B* begin() const;
17
B* end() const;
18
};
19
20
template <typename Ret>
21
struct D
22
{
23
Ret f(const C &p)
24
{
25
for (const B &i: p) // OK
26
i.second.get_value<int>();
27
for (const auto &i: p) // ERROR
28
i.second.get_value<int>();
29
return Ret(0);
30
}
31
};
32
33
void g()
34
{
35
D<int>().f(C());
36
}