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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.robertl/] [eb43.C] - Blame information for rev 841

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
// { dg-do assemble  }
2
// All the pointer_to_binary_function cases used to fail because g++
3
// couldn't handle converting an overloaded function to a class type.
4
// The first one should still fail because it requires an implicit conversion
5
// to pointer_to_binary_function, which has an `explicit' constructor.
6
 
7
#include 
8
#include 
9
#include 
10
 
11
using namespace std;
12
 
13
template  class Expr
14
{
15
public :
16
  Expr(){};
17
  Expr(const T&){};
18
};
19
 
20
template 
21
inline bool compare(const Expr a, const Expr b){ return true; }
22
 
23
int main()
24
{
25
  vector        a(3);
26
  sort( a.begin(), a.end(),
27
        static_cast,const Expr)>(compare) );
28
  sort( a.begin(), a.end(), compare );
29
  sort::iterator,
30
       pointer_to_binary_function, const Expr, bool> >
31
    ( a.begin(), a.end(), compare ); // { dg-error "" } constructor is explicit
32
  sort( a.begin(), a.end(),
33
        ptr_fun, const Expr, bool> (compare) );
34
  sort( a.begin(), a.end(),
35
        ptr_fun(compare) );
36
  sort( a.begin(), a.end(),
37
        pointer_to_binary_function, const Expr, bool>(compare) );
38
  sort( a.begin(), a.end(),
39
        pointer_to_binary_function, const Expr, bool>(compare) );
40
  sort( a.begin(), a.end(),
41
        pointer_to_binary_function, const Expr, bool>(compare<>) );
42
}

powered by: WebSVN 2.1.0

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