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

[fuzz] Assertion `!R.empty() && "lookup for a constructor or assignment operator was empty"' failed. #22231

Open
llvmbot opened this issue Dec 11, 2014 · 6 comments
Labels
bugzilla Issues migrated from bugzilla clang:frontend Language frontend issues, e.g. anything involving "Sema" confirmed Verified by a second party crash-on-invalid

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Dec 11, 2014

Bugzilla Link 21857
Version trunk
OS Linux
Attachments test case
Reporter LLVM Bugzilla Contributor
CC @zygoloid

Extended Description

Fuzzing discovered that the attached test case, when given as input to

clang -fno-crash-diagnostics -std=c++11 -xc++ -c -emit-llvm

causes this assertion failure:

clang-3.6: tools/clang/lib/Sema/SemaLookup.cpp:2504: Sema::SpecialMemberOverloadResult *clang::Sema::LookupSpecialMember(clang::CXXRecordDecl *, clang::Sema::CXXSpecialMember, bool, bool, bool, bool, bool): Assertion `!R.empty() && "lookup for a constructor or assignment operator was empty"' failed.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Feb 2, 2015

This assertion is triggered by the following well-formed (AFAIK) code (tested on trunk):

template<typename Fn>
struct fun : Fn
{
    fun() = default;
    fun(Fn fn) : Fn(fn) {}
    using Fn::operator();
};

template<typename Fn>
fun<Fn> wrap(Fn fn)
{
    return fun<Fn>(fn);
}

int main()
{
    wrap([](){});
}

Bit of a PITA. I haven't found a work-around.

@zygoloid
Copy link
Mannequin

zygoloid mannequin commented Feb 11, 2015

Fixed in r228785.

@zygoloid
Copy link
Mannequin

zygoloid mannequin commented Feb 11, 2015

Eric's rejects-valid with lambdas is fixed, the testcase produced by the fuzzer still fails, and looks like an unrelated error-recovery issue.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 9, 2021
@shafik
Copy link
Collaborator

shafik commented Jun 16, 2023

No longer reproduces on trunk: https://godbolt.org/z/ojxPe9qsG

Looks like it was fixed after clang-3

@shafik shafik closed this as not planned Won't fix, can't repro, duplicate, stale Jun 16, 2023
@EugeneZelenko EugeneZelenko added clang:frontend Language frontend issues, e.g. anything involving "Sema" worksforme Resolved as "works for me" and removed clang Clang issues not falling into any other category labels Jun 16, 2023
@llvmbot
Copy link
Collaborator Author

llvmbot commented Jun 16, 2023

@llvm/issue-subscribers-clang-frontend

@Endilll
Copy link
Contributor

Endilll commented Jun 17, 2023

The second example doesn't reproduce even with assertions builds: https://godbolt.org/z/4jdhcrrso
But the original example still crashes: https://godbolt.org/z/nPqcjMvT3

@Endilll Endilll reopened this Jun 17, 2023
@Endilll Endilll added crash-on-invalid confirmed Verified by a second party and removed worksforme Resolved as "works for me" labels Jun 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang:frontend Language frontend issues, e.g. anything involving "Sema" confirmed Verified by a second party crash-on-invalid
Projects
None yet
Development

No branches or pull requests

4 participants