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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [parse/] [pr26997.C] - Blame information for rev 801

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

Line No. Rev Author Line
1 693 jeremybenn
// PR c++/26997
2
// { dg-do compile }
3
void * malloc (unsigned long size);
4
typedef struct { int a; } t;
5
 
6
void foo()
7
{
8
  t *v3;
9
  v3 = (t *)
10
    malloc(
11
           sizeof(t)
12
           *
13
           t->a // { dg-error "before '->' token" }
14
           );
15
}
16
 
17
class C {
18
public:
19
  void operator[](int);
20
};
21
 
22
C bar (void)
23
{
24
  (C ())(3); // { dg-error "invalid cast" }
25
  return (C ());
26
}
27
 
28
extern void baz (C,C);
29
 
30
void foo1 (void)
31
{
32
  baz ((C()), (C()));
33
}
34
 
35
struct S {
36
  void operator()(int);
37
};
38
 
39
int *var;
40
void foo2 (void)
41
{
42
  C ()[2];
43
  (C ())[2];
44
  (S ())(3); // { dg-error "invalid cast" }
45
  (C())*var; // { dg-error "invalid cast" }
46
  (C())+var;  // { dg-error "invalid cast" }
47
  S()(3);
48
  (S()(3));
49
}
50
 

powered by: WebSVN 2.1.0

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