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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [template/] [error38.C] - Blame information for rev 715

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

Line No. Rev Author Line
1 693 jeremybenn
// Testcase for printing typename/typedef bindings as well as template args
2
// in diagnostics (PR c++/25185)
3
 
4
template 
5
struct A {
6
  typename T::type f();         // { dg-message "typename T::type = void*" }
7
  void f(int i = 0);            // { dg-message "" }
8
 
9
  typedef typename T::type mytype;
10
  mytype g();                   // { dg-message "mytype = void*" }
11
  void g(int i = 0);            // { dg-message "" }
12
};
13
 
14
struct B
15
{
16
  typedef void* type;
17
};
18
 
19
// Also make sure that deduced template arguments get canonicalized.
20
 
21
template 
22
void f (T &t);                     // { dg-message "T = int" }
23
 
24
template 
25
void f (T &t, int = 0);             // { dg-message "" }
26
 
27
typedef int myint;
28
myint i;
29
myint *p;
30
 
31
int main()
32
{
33
  A a;
34
  a.f();                        // { dg-error "" }
35
  // { dg-message "candidate" "candidate note" { target *-*-* } 34 }
36
  a.g();                        // { dg-error "" }
37
  // { dg-message "candidate" "candidate note" { target *-*-* } 36 }
38
 
39
  f(i);                         // { dg-error "" }
40
  // { dg-message "candidate" "candidate note" { target *-*-* } 39 }
41
  f(p);                         // { dg-error "" }
42
  // { dg-message "candidate" "candidate note" { target *-*-* } 41 }
43
}

powered by: WebSVN 2.1.0

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