OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [pr51547.C] - Blame information for rev 774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// PR c++/51547
2
// { dg-options "-std=c++0x" }
3
 
4
template 
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() const {
24
    return bar_;
25
  }
26
 
27
  vector bar_;
28
};
29
 
30
template 
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 
40
void foo() {
41
  Foo a;
42
  auto b = a.bar().begin();
43
  auto&& c = b->x;
44
}
45
 
46
int main() {
47
  Y p;
48
  p.foo();
49
  foo();
50
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.