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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc4/] [gcc/] [testsuite/] [g++.old-deja/] [g++.pt/] [memtemp96.C] - Rev 519

Compare with Previous | Blame | View Log

// { dg-do run  }
// Test for partial specialization of a member function template.
// Origin: Jason Merrill <jason@cygnus.com>

template <class T> struct A {
  template <class U> int f(U) { return 42; }
};

template <>
template <class U>
int A<char>::f(U);

template <>
template <class U>
int A<double>::f(U) { return 24; }

int main ()
{
  A<int> ai;
  if (ai.f(0) != 42)
    return 1;

  A<double> ad;
  if (ad.f(0) != 24)
    return 1;

  A<char> ac;
  if (ac.f(0) != 36)
    return 1;
}

template <>
template <class U>
int A<char>::f(U) { return 36; }

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.