brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · a788ea3 Raw
26 lines · cpp
1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9// UNSUPPORTED: no-threads10// REQUIRES: c++03 || c++11 || c++14 || c++17 || c++2011 12// No diagnostic gets emitted when we build with modules.13// XFAIL: clang-modules-build14 15// This test ensures that we issue a reasonable diagnostic when including <atomic> after16// <stdatomic.h> has been included. Before C++23, this otherwise leads to obscure errors17// because <atomic> may try to redefine things defined by <stdatomic.h>.18 19// Ignore additional weird errors that happen when the two headers are mixed.20// ADDITIONAL_COMPILE_FLAGS: -Xclang -verify-ignore-unexpected=error -Xclang -verify-ignore-unexpected=warning21 22#include <stdatomic.h>23#include <atomic>24 25// expected-error@*:* {{<atomic> is incompatible with <stdatomic.h> before C++23.}}26