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/] [spec26.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) 2005 Free Software Foundation, Inc.
// Copyright (C) 2005 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 16 Sep 2005 
// Contributed by Nathan Sidwell 16 Sep 2005 
// PR 23519  template specialization ordering (DR214)
// PR 23519  template specialization ordering (DR214)
// Origin:  Maxim Yegorushkin 
// Origin:  Maxim Yegorushkin 
struct A
struct A
{
{
    template int operator+(T&) { return 1;}
    template int operator+(T&) { return 1;}
};
};
template struct B
template struct B
{
{
  int operator-(A&) {return 2;}
  int operator-(A&) {return 2;}
  template int operator*(R&) {return 3;}
  template int operator*(R&) {return 3;}
};
};
template  int operator-(B, R&) {return 4;}
template  int operator-(B, R&) {return 4;}
template int operator+(A&, B&) { return 5;}
template int operator+(A&, B&) { return 5;}
template  int operator*(T &, A&){return 6;}
template  int operator*(T &, A&){return 6;}
int main()
int main()
{
{
  A a;
  A a;
  B b;
  B b;
  if ((a + b) != 5)
  if ((a + b) != 5)
    return 1;
    return 1;
  if ((b - a) != 2)
  if ((b - a) != 2)
    return 2;
    return 2;
  if ((b * a) != 6)
  if ((b * a) != 6)
    return 3;
    return 3;
}
}
 
 

powered by: WebSVN 2.1.0

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