summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/gcc.dg/qual-return-3.c
blob: e65f86d547d42e986d8c8bac30e91566f28b251f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* Test for warnings for qualified function return types.  Bug 15052
   from Olatunji Ruwase (tjruwase at stanfordalumni.org): qualifiers
   should not be lost when merging declarations.  */

/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
/* { dg-do compile } */
/* { dg-options "" } */

int foo (); /* { dg-message "note: previous declaration" "different qualifiers" } */
const int foo () { return 0; } /* { dg-error "conflicting types" "different qualifiers" } */

void bar (void);
volatile void bar () { } /* { dg-warning "qualified|volatile" "different qualifiers" } */

volatile void baz (void);
void baz () { } /* { dg-warning "not compatible" "different qualifiers" } */
OpenPOWER on IntegriCloud