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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 699 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
// { dg-prune-output "note" }
8
 
9
#include 
10
#include 
11
#include 
12
 
13
using namespace std;
14
 
15
template  class Expr
16
{
17
public :
18
  Expr(){}
19
  Expr(const T&){}
20
};
21
 
22
template 
23
inline bool compare(const Expr a, const Expr b){ return true; }
24
 
25
int main()
26
{
27
  vector        a(3);
28
  sort( a.begin(), a.end(),
29
        static_cast,const Expr)>(compare) );
30
  sort( a.begin(), a.end(), compare );
31
  sort::iterator,
32
       pointer_to_binary_function, const Expr, bool> >
33
    ( a.begin(), a.end(), compare ); // { dg-error "" } constructor is explicit
34
  sort( a.begin(), a.end(),
35
        ptr_fun, const Expr, bool> (compare) );
36
  sort( a.begin(), a.end(),
37
        ptr_fun(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
  sort( a.begin(), a.end(),
43
        pointer_to_binary_function, const Expr, bool>(compare<>) );
44
}

powered by: WebSVN 2.1.0

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