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] - Rev 693

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>();
}

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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