LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 21857 - [fuzz] Assertion `!R.empty() && "lookup for a constructor or assignment operator was empty"' failed.
Summary: [fuzz] Assertion `!R.empty() && "lookup for a constructor or assignment opera...
Status: REOPENED
Alias: None
Product: clang
Classification: Unclassified
Component: -New Bugs (show other bugs)
Version: trunk
Hardware: PC Linux
: P normal
Assignee: Unassigned Clang Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-10 16:01 PST by Sami Liedes
Modified: 2015-02-10 19:53 PST (History)
3 users (show)

See Also:
Fixed By Commit(s):


Attachments
test case (70 bytes, text/x-c++src)
2014-12-10 16:01 PST, Sami Liedes
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sami Liedes 2014-12-10 16:01:34 PST
Created attachment 13498 [details]
test case

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.
Comment 1 Eric Niebler 2015-02-01 17:08:43 PST
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.
Comment 2 Richard Smith 2015-02-10 19:48:56 PST
Fixed in r228785.
Comment 3 Richard Smith 2015-02-10 19:53:03 PST
Eric's rejects-valid with lambdas is fixed, the testcase produced by the fuzzer still fails, and looks like an unrelated error-recovery issue.