[PATCH] D67023: Diagnose use of ATOMIC_VAR_INIT

2019-09-04 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D67023#1656453 , @jfb wrote: > In D67023#1654704 , @aaron.ballman > wrote: > > > In D67023#1654070 , @jfb wrote: > > > > > I refer you to

[PATCH] D67023: Diagnose use of ATOMIC_VAR_INIT

2019-09-03 Thread JF Bastien via Phabricator via cfe-commits
jfb added a comment. In D67023#1654704 , @aaron.ballman wrote: > In D67023#1654070 , @jfb wrote: > > > I refer you to http://wg21.link/p0883 > > I don’t think this diagnostic should be added to clang until p0883

[PATCH] D67023: Diagnose use of ATOMIC_VAR_INIT

2019-09-02 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D67023#1654070 , @jfb wrote: > I refer you to http://wg21.link/p0883 > I don’t think this diagnostic should be added to clang until p0883 is fully > implemented, even just for C. Otherwise we leave users with no

[PATCH] D67023: Diagnose use of ATOMIC_VAR_INIT

2019-09-01 Thread JF Bastien via Phabricator via cfe-commits
jfb added a comment. I refer you to http://wg21.link/p0883 I don’t think this diagnostic should be added to clang until p0883 is fully implemented, even just for C. Otherwise we leave users with no portable way to do the right thing without diagnostic. CHANGES SINCE LAST ACTION

[PATCH] D67023: Diagnose use of ATOMIC_VAR_INIT

2019-09-01 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D67023#1653425 , @jfb wrote: > Is atomic initialization now correct in all modes (including C++) without > this macro? My understanding is yes, but I am not an expert in atomics. However, the diagnostic is currently

[PATCH] D67023: Diagnose use of ATOMIC_VAR_INIT

2019-08-30 Thread JF Bastien via Phabricator via cfe-commits
jfb added a comment. Is atomic initialization now correct in all modes (including C++) without this macro? I don’t think we should diagnose until such a time because some code uses to macro to be portably correct. IIRC we only ended up fixing C++ in 20 with Nico’s paper (after Olivier and I

[PATCH] D67023: Diagnose use of ATOMIC_VAR_INIT

2019-08-30 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman marked an inline comment as done. aaron.ballman added inline comments. Comment at: lib/Lex/PPMacroExpansion.cpp:523 + llvm::sys::path::filename(getSourceManager().getFilename( + M.getLocalDirective()->getLocation())) == "stdatomic.h") { +

[PATCH] D67023: Diagnose use of ATOMIC_VAR_INIT

2019-08-30 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: lib/Lex/PPMacroExpansion.cpp:523 + llvm::sys::path::filename(getSourceManager().getFilename( + M.getLocalDirective()->getLocation())) == "stdatomic.h") { +Diag(Identifier, diag::warn_pp_macro_deprecated)

[PATCH] D67023: Diagnose use of ATOMIC_VAR_INIT

2019-08-30 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman created this revision. aaron.ballman added reviewers: rsmith, jyknight, joerg. Herald added a subscriber: jfb. The `ATOMIC_VAR_INIT` was deprecated in C17 (C17 7.31.8p2), largely because it is fundamentally broken. It has already been proposed to be removed from C2x