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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [lookup/] [using45.C] - Rev 693

Compare with Previous | Blame | View Log

// PR c++/30195
// { dg-do run }

template <class T>
struct A
{
    int f(int) { return 0; }
    int f(double) { return 1; }
    int f(char) { return 2; }
};

template <class T>
struct B : A<T>
{
    using A<T>::f;
    int f(int) { return 3; }
};

int main()
{
    B<int> b;
    if( b.f( 42 ) != 3 )
        __builtin_abort();

    if( b.f( 3.14 ) != 1 )
        __builtin_abort();

    if( b.f( 'a' ) != 2 )
        __builtin_abort();

    if( b.A<int>::f( 42 ) != 0 )
        __builtin_abort();
}

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.