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 4656 - clang c++ crash with destructor and template specialization
Summary: clang c++ crash with destructor and template specialization
Status: RESOLVED FIXED
Alias: None
Product: clang
Classification: Unclassified
Component: C++ (show other bugs)
Version: unspecified
Hardware: PC Linux
: P normal
Assignee: Unassigned Clang Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-30 19:09 PDT by Eli Friedman
Modified: 2010-02-22 12:48 PST (History)
3 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eli Friedman 2009-07-30 19:09:16 PDT
Testcase:
struct A { ~A(); };
template <class T> struct B {};
template <> struct B<int> : private A {};
B<int> foo;

Crashes with the following assertion:
clang-cc: /home/eli/llvm/tools/clang/lib/AST/DeclarationName.cpp:306: clang::DeclarationName clang::DeclarationNameTable::getCXXSpecialName(clang::DeclarationName::NameKind, clang::QualType): Assertion `Ty->isCanonical() && "Can only build C++ special names from canonical types"' failed.
Comment 1 Anders Johnsen 2009-08-20 18:59:11 PDT
I'm not able to reproduce this one with trunk. I get another assertion if I try to emit code, but it does not look related.
Comment 2 Douglas Gregor 2009-08-20 19:06:04 PDT
I bet the bug was fixed when we introduced canonical type smart pointers; getCXXSpecialName is now (statically) guaranteed to get a canonical type. Closing!