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++.pt/] [unify6.C] - Blame information for rev 149

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

Line No. Rev Author Line
1 149 jeremybenn
// { dg-do assemble  }
2
 
3
// Copyright (C) 1999 Free Software Foundation, Inc.
4
// Contributed by Nathan Sidwell 21 May 1999 
5
 
6
// Template deduction and type unification should not issue diagnostics when
7
// they're trying to see if it's possible.  Here deduction fails in some cases
8
// because you cant cv qualify a function type.
9
 
10
template void fn(){} // A
11
 
12
template void fn(T const *){} // B
13
 
14
// these next two specializations need to know if they're specializing A or B.
15
// They specialize A, because they can't instantiate B.
16
 
17
template<> void fn() {} // ok, specialize A
18
 
19
template<> void fn() {} // ok, specialize A
20
 
21
// now make sure we moan when we really should
22
template void foo(T const *){}
23
 
24
void f()
25
{
26
  foo(); // { dg-error "" } attempt to build int & const *
27
  foo(); // { dg-error "" } attempt to build void (const *)()
28
}
29
 
30
typedef void (*Fptr)();
31
 
32
template void PV(Fptr const &, T const * const &);
33
template void PV(T1 const * const &, T2 const * const &);
34
 
35
void baz()
36
{
37
  void *t;
38
  PV(&baz, t);
39
}

powered by: WebSVN 2.1.0

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