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.
* g++.dg/coroutines/pr100772-a.C: Likewise.
* g++.dg/coroutines/pr100772-b.C: Likewise.
-#ifdef __clang__
+#if !__has_include(<coroutine>) \
+ && __has_include(<experimental/coroutine>) // for __clang__
#include <experimental/coroutine>
namespace std {
using namespace std::experimental;
// { dg-additional-options "-fsyntax-only " }
-#ifdef __clang__
+#if !__has_include(<coroutine>) \
+ && __has_include(<experimental/coroutine>) // for __clang__
#include <experimental/coroutine>
namespace std {
using namespace std::experimental;
-#ifdef __clang__
+#if !__has_include(<coroutine>) \
+ && __has_include(<experimental/coroutine>) // for __clang__
#include <experimental/coroutine>
namespace std {
using namespace std::experimental;