URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Go to most recent revision |
Details |
Compare with Previous |
View Log
Line No. |
Rev |
Author |
Line |
1 |
689 |
jeremybenn |
/* Test diagnostics for calling function returning qualified void or
|
2 |
|
|
other incomplete type other than void. PR 35210. */
|
3 |
|
|
/* { dg-do compile } */
|
4 |
|
|
/* { dg-options "-pedantic-errors" } */
|
5 |
|
|
|
6 |
|
|
const void f_cv (void);
|
7 |
|
|
struct s f_s (void);
|
8 |
|
|
void f_v (void);
|
9 |
|
|
|
10 |
|
|
void g1 (void) { f_cv (); } /* { dg-error "qualified void" } */
|
11 |
|
|
void g2 (void) { f_s (); } /* { dg-error "invalid use of undefined type" } */
|
12 |
|
|
void g3 (void) { ((const void (*) (void)) f_v) (); } /* { dg-error "qualified void" } */
|
13 |
|
|
/* { dg-warning "function called through a non-compatible type" "cast" { target *-*-* } 12 } */
|
14 |
|
|
/* { dg-message "will abort" "abort" { target *-*-* } 12 } */
|
15 |
|
|
void g4 (void) { ((struct s (*) (void)) f_v) (), (void) 0; } /* { dg-error "invalid use of undefined type" } */
|
16 |
|
|
/* { dg-warning "function called through a non-compatible type" "cast" { target *-*-* } 15 } */
|
17 |
|
|
/* { dg-message "will abort" "abort" { target *-*-* } 15 } */
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.