[cfe-dev] Question about c++x0 explicit virtual functions

Jean-Daniel Dupas devlists at shadowlab.org
Mon Jan 24 10:13:02 PST 2011


Thank you for the answer.

Bug filled at http://llvm.org/bugs/show_bug.cgi?id=9037



Le 24 janv. 2011 à 19:00, Anders Carlsson a écrit :

> Hi Jean-Daniel,
> 
> the keywords currently don't work in on inline member functions.
> 
> While this is correct according to the C++0x spec, please file a bug so we can support it anyway. Maybe we could get the spec fixed as well.
> 
> - Anders
> 
> On Jan 24, 2011, at 9:51 AM, Jean-Daniel Dupas wrote:
> 
>> Hello,
>> 
>> I'm trying to use the new explicit/override/new/final keywords, but I have trouble with some constructs.
>> As I don't managed to find the part of the specification that describe theses new keywords, I hope someone here can help me.
>> 
>> If I declare the classes A and B as follow, everything is fine. clang compiles and properly checks that foo() is declared in the super class (A).
>> 
>> class A { virtual void foo(); };
>> class B : public A { virtual void foo() override; };
>> 
>> Now, if I want to define B::foo() in my class definition like this:
>> 
>> class B : public A { virtual void foo() override {} };
>> 
>> clang refuses to compile by telling me it expects a semi at end of declaration list (and point to the space just behind override).
>> 
>> Is there something I miss in these new keyword usages, or is it a clang error, or is this construct prohibited by the C++ current standard ? 
>> 
>> Thanks
>> 
>> -- Jean-Daniel
>> 
>> 
>> 
>> 
>> 
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
> 

-- Jean-Daniel




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110124/f656fdb7/attachment.html>


More information about the cfe-dev mailing list