From b287a015e3a8f19734762f89ff02d877037c80e9 Mon Sep 17 00:00:00 2001 From: Erik Pilkington Date: Mon, 29 Oct 2018 03:24:16 +0000 Subject: Revert "Support for groups of attributes in #pragma clang attribute" This reverts commit r345486. Looks like it causes some old versions of GCC to crash, I'll see if I can work around it and recommit... llvm-svn: 345487 --- clang/test/Parser/pragma-attribute.cpp | 7 +++---- clang/test/Sema/pragma-attribute.c | 23 ----------------------- 2 files changed, 3 insertions(+), 27 deletions(-) (limited to 'clang/test') diff --git a/clang/test/Parser/pragma-attribute.cpp b/clang/test/Parser/pragma-attribute.cpp index c4ae2056fb9..bf14319fc55 100644 --- a/clang/test/Parser/pragma-attribute.cpp +++ b/clang/test/Parser/pragma-attribute.cpp @@ -100,12 +100,11 @@ void function(); #pragma clang attribute push(__attribute__((annotate("test"))), apply_to = any( variable(unless(is_parameter)), variable(unless(is_parameter)) )) // expected-error {{duplicate attribute subject matcher 'variable(unless(is_parameter))'}} #pragma clang attribute push(__attribute__((annotate("test"))), apply_to = any( variable(unless(is_parameter)), variable(unless(is_parameter)), enum, variable(unless(is_parameter)) )) // expected-error 2 {{duplicate attribute subject matcher 'variable(unless(is_parameter))'}} -#pragma clang attribute // expected-error {{expected 'push', 'pop', or '(' after '#pragma clang attribute'}} -#pragma clang attribute 42 // expected-error {{expected 'push', 'pop', or '(' after '#pragma clang attribute'}} +#pragma clang attribute // expected-error {{expected 'push' or 'pop' after '#pragma clang attribute'}} +#pragma clang attribute 42 // expected-error {{expected 'push' or 'pop' after '#pragma clang attribute'}} #pragma clang attribute pushpop // expected-error {{unexpected argument 'pushpop' to '#pragma clang attribute'; expected 'push' or 'pop'}} -#pragma clang attribute push -#pragma clang attribute pop +#pragma clang attribute push // expected-error {{expected '('}} #pragma clang attribute push ( // expected-error {{expected an attribute after '('}} #pragma clang attribute push (__attribute__((annotate)) // expected-error {{expected ')'}} #pragma clang attribute push () // expected-error {{expected an attribute after '('}} diff --git a/clang/test/Sema/pragma-attribute.c b/clang/test/Sema/pragma-attribute.c index 202b3f75faa..d321f2ce4be 100644 --- a/clang/test/Sema/pragma-attribute.c +++ b/clang/test/Sema/pragma-attribute.c @@ -38,29 +38,6 @@ __attribute__((always_inline)) void optnone3() { } // expected-warning {{'always #pragma clang attribute pop -#pragma clang attribute push (__attribute__((annotate())), apply_to = function) // expected-error{{'annotate' attribute takes one argument}} -#pragma clang attribute (__attribute__((annotate())), apply_to = function) // expected-error{{'annotate' attribute takes one argument}} - -void fun(); // expected-note 2 {{when applied to this declaration}} - -#pragma clang attribute pop -#pragma clang attribute pop // expected-error{{'#pragma clang attribute pop' with no matching '#pragma clang attribute push'}} - - -#pragma clang attribute push -#pragma clang attribute (__attribute__((annotate())), apply_to = function) // expected-error 2 {{'annotate' attribute takes one argument}} - -void fun2(); // expected-note {{when applied to this declaration}} - -#pragma clang attribute push (__attribute__((annotate())), apply_to = function) // expected-error{{'annotate' attribute takes one argument}} -void fun3(); // expected-note 2 {{when applied to this declaration}} -#pragma clang attribute pop - -#pragma clang attribute pop -#pragma clang attribute pop // expected-error{{'#pragma clang attribute pop' with no matching '#pragma clang attribute push'}} - -#pragma clang attribute (__attribute__((annotate)), apply_to = function) // expected-error{{'#pragma clang attribute' attribute with no matching '#pragma clang attribute push}} - #pragma clang attribute push ([[]], apply_to = function) // A noop #pragma clang attribute pop // expected-error {{'#pragma clang attribute pop' with no matching '#pragma clang attribute push'}} -- cgit v1.2.3