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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [template/] [using1.C] - Diff between revs 149 and 154

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 149 Rev 154
// { dg-do run }
// { dg-do run }
// Copyright (C) 2003 Free Software Foundation, Inc.
// Copyright (C) 2003 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 22 Jul 2003 
// Contributed by Nathan Sidwell 22 Jul 2003 
// PR 9447. Using decls in template classes.
// PR 9447. Using decls in template classes.
template 
template 
struct Foo {
struct Foo {
  int i;
  int i;
};
};
struct Baz
struct Baz
{
{
  int j;
  int j;
};
};
template 
template 
struct Bar : public Foo, Baz {
struct Bar : public Foo, Baz {
  using Foo::i;
  using Foo::i;
  using Baz::j;
  using Baz::j;
  int foo () { return i; }
  int foo () { return i; }
  int baz () { return j; }
  int baz () { return j; }
};
};
int main()
int main()
{
{
  Bar bar;
  Bar bar;
  bar.i = 1;
  bar.i = 1;
  bar.j = 2;
  bar.j = 2;
  if (bar.foo() != 1)
  if (bar.foo() != 1)
    return 1;
    return 1;
  if (bar.baz() != 2)
  if (bar.baz() != 2)
    return 1;
    return 1;
  return 0;
  return 0;
}
}
 
 

powered by: WebSVN 2.1.0

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