https://bugs.llvm.org/show_bug.cgi?id=40894
Bug ID: 40894
Summary: Wdelete-abstract-non-virtual-dtor incorrect
message/fixit in template
Product: clang
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: C++
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected], [email protected],
[email protected]
--
struct Foo {
virtual void bar() = 0;
};
template <typename T>
void destroy(T *t) {
t->~T();
}
void destroyFoo(Foo *foo) {
destroy(foo);
}
--
Clang produces:
<source>:7:5: warning: destructor called on 'Foo' that is abstract but has
non-virtual destructor [-Wdelete-abstract-non-virtual-dtor]
t->~T();
^
<source>:11:5: note: in instantiation of function template specialization
'destroy<Foo>' requested here
destroy(foo);
^
<source>:7:9: note: qualify call to silence this warning
t->~T();
^
Foo::
The fixit suggests inserting the concrete type name (Foo::) inside the template
function, which doesn't make sense. Interestingly, inserting T:: doesn't work
either; it's invalid syntax for whatever reason.
I'm not sure what the warning should do in this case, but as is, the fixit is
incorrect, and it's apparently impossible to "qualify call to silence this
warning" as the note says.
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs