File tree 3 files changed +12
-0
lines changed
3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,9 @@ Improvements to Coverage Mapping
133
133
Bug Fixes in This Version
134
134
-------------------------
135
135
136
+ - Fixed the definition of ``ATOMIC_FLAG_INIT `` in ``<stdatomic.h> `` so it can
137
+ be used in C++.
138
+
136
139
Bug Fixes to Compiler Builtins
137
140
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
138
141
Original file line number Diff line number Diff line change @@ -172,7 +172,11 @@ typedef _Atomic(uintmax_t) atomic_uintmax_t;
172
172
173
173
typedef struct atomic_flag { atomic_bool _Value; } atomic_flag;
174
174
175
+ #ifdef __cplusplus
176
+ #define ATOMIC_FLAG_INIT {false }
177
+ #else
175
178
#define ATOMIC_FLAG_INIT { 0 }
179
+ #endif
176
180
177
181
/* These should be provided by the libc implementation. */
178
182
#ifdef __cplusplus
Original file line number Diff line number Diff line change 1
1
// RUN: %clang_cc1 -std=c11 -E %s | FileCheck %s
2
2
// RUN: %clang_cc1 -std=c11 -fms-compatibility -E %s | FileCheck %s
3
+ // RUN: %clang_cc1 -std=c11 %s -verify
4
+ // RUN: %clang_cc1 -x c++ -std=c++11 %s -verify
5
+ // expected-no-diagnostics
3
6
#include <stdatomic.h>
4
7
5
8
int bool_lock_free = ATOMIC_BOOL_LOCK_FREE ;
@@ -31,3 +34,5 @@ int llong_lock_free = ATOMIC_LLONG_LOCK_FREE;
31
34
32
35
int pointer_lock_free = ATOMIC_POINTER_LOCK_FREE ;
33
36
// CHECK: pointer_lock_free = {{ *[012] *;}}
37
+
38
+ atomic_flag f = ATOMIC_FLAG_INIT ;
You can’t perform that action at this time.
0 commit comments