aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2021-07-22 14:23:32 -0700
committerDavid Blaikie <dblaikie@gmail.com>2021-07-22 14:51:56 -0700
commit83225936af317e6bdd7103a8a039c51a29ce9f57 (patch)
treea3901c0ef007f9eef78c673a2658a78d52013ca9 /clang/lib/Frontend/CompilerInvocation.cpp
parenta806f933a2bf7db444c5687d8d4e07910150ed9c (diff)
downloadllvm-83225936af317e6bdd7103a8a039c51a29ce9f57.zip
llvm-83225936af317e6bdd7103a8a039c51a29ce9f57.tar.gz
llvm-83225936af317e6bdd7103a8a039c51a29ce9f57.tar.bz2
PR51158: Don't emit -Wswitch or -Wcovered-switch-default for empty enums
An empty enum is used to implement C++'s new-ish "byte" type (to make sure it's a separate type for overloading, etc - compared to a typedef) - without any enumerators. Some clang warnings don't make sense in this sort of situation, so let's skip them for empty enums. It's arguable that possibly some situations of enumerations without enumerators might want the previous-to-this-patch behavior (if the enum is autogenerated and in some cases comes up empty, then maybe a default in an empty switch would still be considered problematic - so that when you add the first enumeration you do get a -Wswitch warning). But I think that's niche enough & this std::byte case is mainstream enough that we should prioritize the latter over the former. If someone's got a middle ground proposal to account for both of those situations, I'm open to patches/suggestions/etc.
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions