[Issue 1918] __traits(getVirtualFunctions) returns final functions

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jan 23 09:25:46 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=1918



--- Comment #11 from yebblies <yebblies at gmail.com> 2012-01-24 04:25:43 EST ---
(In reply to comment #10)
> final functions which don't override anything _definitely_ shouldn't be
> virtual. There's no reason for them to be virtual, and it harms performance. If
> the compiler fails to make them non-virtual, then that's definitely a bug.

By the looks of it, the compiler manages to optimize out the virtual call with
all final functions, which is probably why nobody ever noticed this before. 
The problem seems to be that whether the functions actually needs a vtable slot
is resolved much too late.  This is essential for linking with c++, which I'm
trying to improve.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list