| 1 |
// RUN: %clang_cc1 -fsyntax-only %s -include %s -verify |
| 2 |
// RUN: %clang_cc1 -Wpedantic -fsyntax-only %s -include %s -verify -DWARN_PEDANTIC |
| 3 |
|
| 4 |
#ifndef enable_if_ext_included |
| 5 |
#define enable_if_ext_included |
| 6 |
|
| 7 |
#if !defined(WARN_PEDANTIC) |
| 8 |
// expected-no-diagnostics |
| 9 |
#endif |
| 10 |
|
| 11 |
__attribute__ (( enable_if(1, "") )) |
| 12 |
#if defined(WARN_PEDANTIC) |
| 13 |
// expected-warning@-2 {{'enable_if' is a clang extension}} |
| 14 |
#endif |
| 15 |
void f(void) { } |
| 16 |
|
| 17 |
__attribute__ (( __enable_if__(1, "") )) |
| 18 |
#if defined(WARN_PEDANTIC) |
| 19 |
// expected-warning@-2 {{'enable_if' is a clang extension}} |
| 20 |
#endif |
| 21 |
void g(void) { } |
| 22 |
|
| 23 |
__attribute__ (( enable_if(0, "") )) |
| 24 |
#if defined(WARN_PEDANTIC) |
| 25 |
// expected-warning@-2 {{'enable_if' is a clang extension}} |
| 26 |
#endif |
| 27 |
void h(void) { } |
| 28 |
|
| 29 |
__attribute__ (( __enable_if__(0, "") )) |
| 30 |
#if defined(WARN_PEDANTIC) |
| 31 |
// expected-warning@-2 {{'enable_if' is a clang extension}} |
| 32 |
#endif |
| 33 |
void i(void) { } |
| 34 |
|
| 35 |
#pragma clang system_header |
| 36 |
|
| 37 |
__attribute__ (( enable_if(1, "") )) |
| 38 |
void j(void) { } |
| 39 |
|
| 40 |
__attribute__ (( __enable_if__(1, "") )) |
| 41 |
void k(void) { } |
| 42 |
|
| 43 |
__attribute__ (( enable_if(0, "") )) |
| 44 |
void l(void) { } |
| 45 |
|
| 46 |
__attribute__ (( __enable_if__(0, "") )) |
| 47 |
void m(void) { } |
| 48 |
|
| 49 |
#endif |
| 50 |
|