http://llvm.org/bugs/show_bug.cgi?id=22793
Bug ID: 22793
Summary: Crash when explicitly instantiating a class template
with a protected defaulted dtor, after a use of that
dtor
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Keywords: compile-fail
Severity: normal
Priority: P
Component: C++11
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
The most basic repro I can come up with is:
template <typename>
struct foo {
protected:
~foo() = default;
friend void func();
};
void func() { foo<int> f; }
template struct foo<int>;
(including an explicit instantiation declaration before the definition of
'func' doesn't help, FWIW)
Other ways to call ~foo<int> still produce the problem - eg: deriving from
foo<int> and having a user-defined dtor or ctor, even if they're never called.
Making the dtor public instead of protected avoids the crash
Defining the dtor as {} instead of "= default" avoids the crash.
This came up in a Clang self-host (reported as PR22791, among other instances).
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs