-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Entire lambda body is printed in a note #125914
Comments
@llvm/issue-subscribers-c-1 Author: Vlad Serebrennikov (Endilll)
Consider the following example (https://godbolt.org/z/P7dqa81bG):
```cpp
class S {
class Incomplete;
struct Inner { static constexpr int r = [] { class Incomplete {};
<source>:10:28: error: call to immediate function 'S::(anonymous class)::operator()' is not a constant expression
|
Hi! This issue may be a good introductory issue for people new to working on LLVM. If you would like to work on this issue, your first steps are:
If you have any further questions about this issue, don't hesitate to ask via a comment in the thread below. |
@llvm/issue-subscribers-good-first-issue Author: Vlad Serebrennikov (Endilll)
Consider the following example (https://godbolt.org/z/P7dqa81bG):
```cpp
class S {
class Incomplete;
struct Inner { static constexpr int r = [] { class Incomplete {};
<source>:10:28: error: call to immediate function 'S::(anonymous class)::operator()' is not a constant expression
|
in ExprConstant.cpp Info.FFDiag(CallLoc, diag::note_constexpr_invalid_function, 1)
<< DiagDecl->isConstexpr() << (bool)CD << DiagDecl;
Info.Note(DiagDecl->getLocation(), diag::note_declared_at);
|
Hey @Endilll , @a-tarasyuk , @cor3ntin |
@ajayrajsaini yes, it's still open. I've assigned it to you. thanks |
hey @cor3ntin i added these lines based on your suggestion:- if (auto *MD = dyn_cast<CXXMethodDecl>(DiagDecl)) {
if (MD->getParent()->isLambda()) {
DiagDecl = MD->getParent(); // Use the lambda instead of its operator
}
} but still i found no changes when i am compiling it ( i am using this to compile:- can you help me a little weather i am on right direction or not and what should be the output. cc:- @a-tarasyuk |
Consider the following example (https://godbolt.org/z/P7dqa81bG):
We issue the following diagnostics for it:
It seems unfortunate that multi-line lambda body gets printed in the
in call to
note.The text was updated successfully, but these errors were encountered: