blob: e1d1b5041f994bb3108be1959663c864ef43e1a2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
// PR c++/54975
// { dg-do compile { target c++11 } }
template<typename T>
struct identity
{
typedef T type;
};
template<typename T>
void f()
{
typedef typename T::type A;
int i = 42;
int const &cri = i;
int volatile &vri = i;
[&]() {
A const &x = cri; // Problem here
A volatile &y = vri; // Likewise
};
}
int main()
{
f<identity<int> >();
}
|