- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When:
- a templated class inherits from one of the template arguments
- a method overrides a (supposedly virtual) method of the base class, declarig it as "final", without declaring it "virtual" in the derived class
icpc comlains with
error: nonvirtual function cannot be declared with "abstract" or "sealed" modifier
while gcc (4.8.1) happily compiles the code.
How to reproduce:
class Base {
public:
virtual const char * name() {
return "Base";
}
};
template <class B>
class Derived : public B {
public:
const char * name() final {
return "Derived";
}
};
Also, the error message is misleading, it should mention "override" or "final", not "abstract" or "sealed" (from C# ?).
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Georg Zitzlsberger (Intel) wrote:
The alternative is to apply the "virtual" keyword to the derived class' function as well.
Yes, that's what we can do in the meantime.
Thanks,
.Andrea
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For the record - this is still open with
$ icpc -v
icpc version 14.0.1 (gcc version 4.8.0 compatibility)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
and it is also open in 14.0.2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
and looks like it is still open in "Intel C++ Composer XE 2015 Pre-Release beta"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Intel(R) Parallel Studio XE 2015 Composer Edition contains the fix.
Best regards,
Georg Zitzlsberger

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Hello,
DPD200388855 is still at engineering. Once there's some progress I'll update this thread.
Best regards,
Georg Zitzlsberger