[PATCH] D19758: [libcxx] [test] Replace non-Standard "atomic_flag f(false); " with Standard "atomic_flag f = ATOMIC_FLAG_INIT; ".

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Mon May 2 12:34:16 PDT 2016


EricWF added a comment.

I actually want this form of initialization to break in C++03, From the original review:

> After putting this question up on cfe-dev I have decided that it would be best to allow the use of <atomic> in C++03. Although static initialization is a concern the syntax required to get it is C++11 only. Meaning that C++11 constant static initialization cannot silently break in C++03, it will always cause a syntax error. Furthermore ATOMIC_VAR_INIT and ATOMIC_FLAG_INIT remain defined in C++03 even though they cannot be used because C++03 usages will cause better error messages.


I think I'll just hack up these tests, or make them require C++11 or greater and add C++03 specific tests elsewhere.


http://reviews.llvm.org/D19758





More information about the cfe-commits mailing list