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 21831 - [fuzz] Assertion `isa<CXXConversionDecl>(Meth) && "expected conversion"' failed.
Summary: [fuzz] Assertion `isa<CXXConversionDecl>(Meth) && "expected conversion"' failed.
Status: RESOLVED FIXED
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: 23057
  Show dependency tree
 
Reported: 2014-12-10 15:18 PST by Sami Liedes
Modified: 2016-10-21 17:44 PDT (History)
3 users (show)

See Also:
Fixed By Commit(s):


Attachments
test case (27 bytes, text/x-c++src)
2014-12-10 15:18 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 15:18:06 PST
Created attachment 13472 [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/SemaOverload.cpp:8546: (anonymous namespace)::OverloadCandidateKind (anonymous namespace)::ClassifyOverloadCandidate(clang::Sema &, clang::FunctionDecl *, std::string &): Assertion `isa<CXXConversionDecl>(Meth) && "expected conversion"' failed.
Comment 1 David Majnemer 2014-12-13 17:12:00 PST
more sane test case:
class C {};
void &C::~C() { C::~C; };

this also crashes MSVC
Comment 2 Reid Kleckner 2016-10-21 17:44:18 PDT
Looks like we fixed it somewhere along the way:

t.cpp:2:6: error: cannot form a reference to 'void'
void &C::~C() { C::~C; };
     ^
t.cpp:2:20: error: reference to destructor must be called; did you mean to call it with no arguments?
void &C::~C() { C::~C; };
                ~~~^~
                     ()
2 errors generated.