From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2140) id 9BED23858C31; Thu, 16 Feb 2023 11:12:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9BED23858C31 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676545955; bh=AF0noEhGfgJhBpufXBkrqrUOnKou1kt0rnoLR2w+TQU=; h=From:To:Subject:Date:From; b=x1Qwb8HEowZMSomohf1CQjI36dwYKrQwwgY7ZGumUpUhQ6+O9qzCJYrN1JWsPt31V RGQI2XKybDz4O3Tk8crWGyL5ul3tJc7qIqznBlH8wCgxh6IMmKnNi3tjrEaHLuldkU eos57h+MiVV+HK1kQWAgq9YGJOsOMuBwTc4z8kIs= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Alexandre Oliva To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/aoliva/heads/testme)] [PR100127] Test for coroutine header in clang-compatible tests X-Act-Checkin: gcc X-Git-Author: Alexandre Oliva X-Git-Refname: refs/users/aoliva/heads/testme X-Git-Oldrev: f41840b0354ccffdf31e60080f49c9f5bcc6dc77 X-Git-Newrev: 8474d8bc4d5b4666796109bdf0edabc0c3ae93ab Message-Id: <20230216111235.9BED23858C31@sourceware.org> Date: Thu, 16 Feb 2023 11:12:35 +0000 (GMT) List-Id: https://gcc.gnu.org/g:8474d8bc4d5b4666796109bdf0edabc0c3ae93ab commit 8474d8bc4d5b4666796109bdf0edabc0c3ae93ab Author: Alexandre Oliva Date: Thu Feb 16 06:52:00 2023 -0300 [PR100127] Test for coroutine header in clang-compatible tests The test is compatible with clang as well as gcc, but ISTM that testing for the __clang__ macro is just as potentially error-prone as macros that used to be GCC-specific are now defined in compilers that aim for GCC compatibility. Use a __has_include feature test instead. for gcc/testsuite/ChangeLog PR c++/100127 * g++.dg/coroutines/pr100127.C: Test for header rather than compiler macro. Diff: --- gcc/testsuite/g++.dg/coroutines/pr100127.C | 2 +- gcc/testsuite/g++.dg/coroutines/pr100772-a.C | 2 +- gcc/testsuite/g++.dg/coroutines/pr100772-b.C | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/testsuite/g++.dg/coroutines/pr100127.C b/gcc/testsuite/g++.dg/coroutines/pr100127.C index 374cd710077..1eaa72ff0ac 100644 --- a/gcc/testsuite/g++.dg/coroutines/pr100127.C +++ b/gcc/testsuite/g++.dg/coroutines/pr100127.C @@ -1,4 +1,4 @@ -#ifdef __clang__ +#if __has_include() // for __clang__ #include namespace std { using namespace std::experimental; diff --git a/gcc/testsuite/g++.dg/coroutines/pr100772-a.C b/gcc/testsuite/g++.dg/coroutines/pr100772-a.C index a325d384fc3..724c377c82e 100644 --- a/gcc/testsuite/g++.dg/coroutines/pr100772-a.C +++ b/gcc/testsuite/g++.dg/coroutines/pr100772-a.C @@ -1,5 +1,5 @@ // { dg-additional-options "-fsyntax-only " } -#ifdef __clang__ +#if __has_include() // for __clang__ #include namespace std { using namespace std::experimental; diff --git a/gcc/testsuite/g++.dg/coroutines/pr100772-b.C b/gcc/testsuite/g++.dg/coroutines/pr100772-b.C index 6cdf8d1e529..4cf31e5f9e0 100644 --- a/gcc/testsuite/g++.dg/coroutines/pr100772-b.C +++ b/gcc/testsuite/g++.dg/coroutines/pr100772-b.C @@ -1,4 +1,4 @@ -#ifdef __clang__ +#if __has_include() // for __clang__ #include namespace std { using namespace std::experimental;