aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/c2x-unproto-4.c
blob: fceff22b1af550b8e82f54344dddd2b7d4c4ef3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* Test that declaring a function with () is the same as (void) in C2X.
   Invalid use cases.  */
/* { dg-do compile } */
/* { dg-options "-std=c2x -pedantic-errors" } */

void f1 (); /* { dg-message "previous declaration" } */
void f1 (int); /* { dg-error "conflicting types" } */

void f2 (); /* { dg-message "declared here" } */

void
f3 (void)
{
  f2 (1); /* { dg-error "too many arguments" } */
}