brintos

brintos / llvm-project-archived public Read only

0
0
Text · 922 B · 09bb287 Raw
16 lines · c
1// RUN: %clang_cc1  -fsyntax-only -verify %s2 3// Decl annotations.4void f(int __attribute__((maybe_undef)) *a);5void (*fp)(int __attribute__((maybe_undef)) handle);6__attribute__((maybe_undef)) int i(); // expected-warning {{'maybe_undef' attribute only applies to parameters}}7int __attribute__((maybe_undef)) a; // expected-warning {{'maybe_undef' attribute only applies to parameters}}8int (* __attribute__((maybe_undef)) fpt)(char *); // expected-warning {{'maybe_undef' attribute only applies to parameters}}9void h(int *a __attribute__((maybe_undef("RandomString")))); // expected-error {{'maybe_undef' attribute takes no arguments}}10 11// Type annotations.12int __attribute__((maybe_undef)) ta; // expected-warning {{'maybe_undef' attribute only applies to parameters}}13 14// Typedefs.15typedef int callback(char *) __attribute__((maybe_undef)); // expected-warning {{'maybe_undef' attribute only applies to parameters}}16