view gcc/testsuite/gcc.dg/qual-return-3.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* 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 "-std=gnu99" } */

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" } */