[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / Parser / stmt-attributes.cpp
blob74192ea68141dcab281174e5ed1a04f6e4d4f50f
1 // RUN: %clang_cc1 -std=c++11 -fcxx-exceptions -fexceptions -fsyntax-only -verify %s
3 #if !__has_extension(statement_attributes_with_gnu_syntax)
4 #error "We should have statement attributes with GNU syntax support"
5 #endif
7 template <typename T = void>
8 class __attribute__((nomerge)) A {
9 // expected-error@-1 {{'nomerge' attribute only applies to functions and statements}}
12 class B : public A<> {
13 public:
14 void bar();
17 void bar();
19 void foo(A<> *obj) {
20 __attribute__((nomerge)) static_cast<B *>(obj)->bar();
21 __attribute__((nomerge))[obj]() { static_cast<B *>(obj)->bar(); }
22 ();
23 __attribute__(()) try {
24 bar();
25 } catch (...) {