With C++17 there is no Clang pedantic warning or MSVC C5051.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
LGTM!
I assume you'll be removing the macro definition from Compiler.h once all the projects have been updated?
Why? There are many years of precedent for using LLVM_FALLTHROUGH and it is very clear and obvious. What do we gain by getting rid of it?
Don't get me wrong, I am not super opposed to using a standard string instead of an LLVM-specific macro. However, it seems that this leaves us with a mixture of the macro and the standard attribute. If we are ready to replace all occurrences in all projects and get rid of the macro altogether (with some warning to downstream users), that seems reasonable. Replacing only some of them seems worse than what we now have.
Less novel macro usage helps readability, but it's a very minor gain IMO.
Don't get me wrong, I am not super opposed to using a standard string instead of an LLVM-specific macro. However, it seems that this leaves us with a mixture of the macro and the standard attribute. If we are ready to replace all occurrences in all projects and get rid of the macro altogether (with some warning to downstream users), that seems reasonable. Replacing only some of them seems worse than what we now have.
FWIW, I was presuming that @MaskRay was removing *all* uses of the macro with the intent to remove it from Compiler.h when the last in-tree use is removed. I agree that only doing this for part of the project would have rather limited benefits. As for a downstream warning; we don't typically give much notice for other API changes, so I don't see it as being *super* critical, but it would certainly be a kindness to give folks a heads up before removing the macro. One thing we could consider doing is using #pragma clang deprecated(LLVM_FALLTHROUGH, "use [[fallthrough]] instead") in Compiler.h while the macro still exists to alert people doing self-builds that the change is coming. It won't help everyone, but it might help some folks?
I will try removing all LLVM_FALLTHROUGH. The per-project approach just finds what may be missing from various bots.