1 // RUN: %clang_cc1 -triple %ms_abi_triple -fms-extensions -verify -fsyntax-only %s
2 // RUN: %clang_cc1 -triple %ms_abi_triple -fms-extensions -verify -std=c++11 -fsyntax-only -x c++ %s
4 // Function definition.
5 __declspec(guard(nocf
)) void testGuardNoCF(void) { // no warning
8 // Can not be used on variable, parameter, or function pointer declarations.
9 int __declspec(guard(nocf
)) i
; // expected-warning {{'guard' attribute only applies to functions}}
10 void testGuardNoCFFuncParam(double __declspec(guard(nocf
)) i
) {} // expected-warning {{'guard' attribute only applies to functions}}
11 __declspec(guard(nocf
)) typedef void (*FuncPtrWithGuardNoCF
)(void); // expected-warning {{'guard' attribute only applies to functions}}
13 // 'guard' Attribute requries an argument.
14 __declspec(guard
) void testGuardNoCFParams(void) { // expected-error {{'guard' attribute takes one argument}}
17 // 'guard' Attribute requries an identifier as argument.
18 __declspec(guard(1)) void testGuardNoCFParamType(void) { // expected-error {{'guard' attribute requires an identifier}}
21 // 'guard' Attribute only takes a single argument.
22 __declspec(guard(nocf
, nocf
)) void testGuardNoCFTooManyParams(void) { // expected-error {{use of undeclared identifier 'nocf'}}
25 // 'guard' Attribute argument must be a supported identifier.
26 __declspec(guard(cf
)) void testGuardNoCFInvalidParam(void) { // expected-warning {{'guard' attribute argument not supported: 'cf'}}