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++.old-deja/] [g++.robertl/] [eb43.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 assemble  }
// { dg-do assemble  }
// All the pointer_to_binary_function cases used to fail because g++
// All the pointer_to_binary_function cases used to fail because g++
// couldn't handle converting an overloaded function to a class type.
// couldn't handle converting an overloaded function to a class type.
// The first one should still fail because it requires an implicit conversion
// The first one should still fail because it requires an implicit conversion
// to pointer_to_binary_function, which has an `explicit' constructor.
// to pointer_to_binary_function, which has an `explicit' constructor.
#include 
#include 
#include 
#include 
#include 
#include 
using namespace std;
using namespace std;
template  class Expr
template  class Expr
{
{
public :
public :
  Expr(){};
  Expr(){};
  Expr(const T&){};
  Expr(const T&){};
};
};
template 
template 
inline bool compare(const Expr a, const Expr b){ return true; }
inline bool compare(const Expr a, const Expr b){ return true; }
int main()
int main()
{
{
  vector        a(3);
  vector        a(3);
  sort( a.begin(), a.end(),
  sort( a.begin(), a.end(),
        static_cast,const Expr)>(compare) );
        static_cast,const Expr)>(compare) );
  sort( a.begin(), a.end(), compare );
  sort( a.begin(), a.end(), compare );
  sort::iterator,
  sort::iterator,
       pointer_to_binary_function, const Expr, bool> >
       pointer_to_binary_function, const Expr, bool> >
    ( a.begin(), a.end(), compare ); // { dg-error "" } constructor is explicit
    ( a.begin(), a.end(), compare ); // { dg-error "" } constructor is explicit
  sort( a.begin(), a.end(),
  sort( a.begin(), a.end(),
        ptr_fun, const Expr, bool> (compare) );
        ptr_fun, const Expr, bool> (compare) );
  sort( a.begin(), a.end(),
  sort( a.begin(), a.end(),
        ptr_fun(compare) );
        ptr_fun(compare) );
  sort( a.begin(), a.end(),
  sort( a.begin(), a.end(),
        pointer_to_binary_function, const Expr, bool>(compare) );
        pointer_to_binary_function, const Expr, bool>(compare) );
  sort( a.begin(), a.end(),
  sort( a.begin(), a.end(),
        pointer_to_binary_function, const Expr, bool>(compare) );
        pointer_to_binary_function, const Expr, bool>(compare) );
  sort( a.begin(), a.end(),
  sort( a.begin(), a.end(),
        pointer_to_binary_function, const Expr, bool>(compare<>) );
        pointer_to_binary_function, const Expr, bool>(compare<>) );
}
}
 
 

powered by: WebSVN 2.1.0

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