Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bogus "fallthrough annotation does not directly precede switch label" warning when [[clang::fallthrough]] is used in lambda #18238

Closed
jckarter opened this issue Nov 9, 2013 · 1 comment
Labels
bugzilla Issues migrated from bugzilla c++11

Comments

@jckarter
Copy link
Contributor

jckarter commented Nov 9, 2013

Bugzilla Link 17864
Resolution FIXED
Resolved on Aug 05, 2014 08:09
Version 3.3
OS All
CC @DougGregor

Extended Description

This code incorrectly warns that the [[clang::falltrhrough]] annotation does not precede a switch label:

void foo(int x) {
[&]{
switch (x) {
case 0:
foo(0);
[[clang::fallthrough]];
case 1:
foo(1);
}
}();
}

Remove the lambda [&]{ }() and the warning goes away.

@llvmbot
Copy link
Member

llvmbot commented Aug 5, 2014

This was fixed in r211599.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 9, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla c++11
Projects
None yet
Development

No branches or pull requests

2 participants