URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [parse/] [pr26997.C] - Rev 826
Compare with Previous | Blame | View Log
// PR c++/26997
// { dg-do compile }
void * malloc (unsigned long size);
typedef struct { int a; } t;
void foo()
{
t *v3;
v3 = (t *)
malloc(
sizeof(t)
*
t->a // { dg-error "before '->' token" }
);
}
class C {
public:
void operator[](int);
};
C bar (void)
{
(C ())(3); // { dg-error "invalid cast" }
return (C ());
}
extern void baz (C,C);
void foo1 (void)
{
baz ((C()), (C()));
}
struct S {
void operator()(int);
};
int *var;
void foo2 (void)
{
C ()[2];
(C ())[2];
(S ())(3); // { dg-error "invalid cast" }
(C())*var; // { dg-error "invalid cast" }
(C())+var; // { dg-error "invalid cast" }
S()(3);
(S()(3));
}