1*67e74705SXin Li // RUN: %clang_cc1 -std=gnu++11 -fsyntax-only -fms-compatibility -verify %s 2*67e74705SXin Li f()3*67e74705SXin Livoid f() { 4*67e74705SXin Li // GNU-style attributes are prohibited in this position. 5*67e74705SXin Li auto P = new int * __attribute__((vector_size(8))); // expected-error {{an attribute list cannot appear here}} \ 6*67e74705SXin Li // expected-error {{invalid vector element type 'int *'}} 7*67e74705SXin Li 8*67e74705SXin Li // Ensure that MS type attribute keywords are still supported in this 9*67e74705SXin Li // position. 10*67e74705SXin Li auto P2 = new int * __sptr; // Ok 11*67e74705SXin Li } 12*67e74705SXin Li 13*67e74705SXin Li void g(int a[static [[]] 5]); // expected-error {{static array size is a C99 feature, not permitted in C++}} 14*67e74705SXin Li 15*67e74705SXin Li namespace { 16*67e74705SXin Li class B { 17*67e74705SXin Li public: test()18*67e74705SXin Li virtual void test() {} test2()19*67e74705SXin Li virtual void test2() {} test3()20*67e74705SXin Li virtual void test3() {} 21*67e74705SXin Li }; 22*67e74705SXin Li 23*67e74705SXin Li class D : public B { 24*67e74705SXin Li public: test()25*67e74705SXin Li void test() __attribute__((deprecated)) final {} // expected-warning {{GCC does not allow an attribute in this position on a function declaration}} test2()26*67e74705SXin Li void test2() [[]] override {} // Ok test3()27*67e74705SXin Li void test3() __attribute__((cf_unknown_transfer)) override {} // Ok, not known to GCC. 28*67e74705SXin Li }; 29*67e74705SXin Li } 30