URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [pr51547.C] - Rev 701
Go to most recent revision | Compare with Previous | Blame | View Log
// PR c++/51547
// { dg-options "-std=c++0x" }
template <class T>
struct vector
{
T*
begin()
{ return &member; }
const T*
begin() const
{ return &member; }
T member;
};
struct Bar {
int x;
};
struct Foo {
const vector<Bar>& bar() const {
return bar_;
}
vector<Bar> bar_;
};
template <class X>
struct Y {
void foo() {
Foo a;
auto b = a.bar().begin();
auto&& c = b->x;
}
};
template <class X>
void foo() {
Foo a;
auto b = a.bar().begin();
auto&& c = b->x;
}
int main() {
Y<int> p;
p.foo();
foo<int>();
}
Go to most recent revision | Compare with Previous | Blame | View Log