Patch to accept over-qualified constructor in MSVC emulation mode

Erik Schwiebert eriksc at microsoft.com
Fri Feb 8 11:14:28 PST 2013


I'm not a qualified code reviewer, but I can say that the Mac Business Unit in Microsoft would like to see this patch adopted. We use clang via Xcode to compile code that was often written originally for MSVC, so the -fms-extensions flag is very valuable to us.

Schwieb

-----Original Message-----
From: cfe-commits-bounces at cs.uiuc.edu [mailto:cfe-commits-bounces at cs.uiuc.edu] On Behalf Of Jason Haslam
Sent: Friday, February 8, 2013 10:13 AM
To: cfe-commits at cs.uiuc.edu
Subject: Re: Patch to accept over-qualified constructor in MSVC emulation mode

Ping. Any interest in this?

Jason


On Feb 6, 2013, at 2:19 PM, Jason Haslam <jason.haslam at gmail.com> wrote:

> MSVC accepts this:
> 
> class A {
>  A::A();
> };
> 
> Clang accepts regular member functions with extra qualification as an MS extension, but not constructors. The attached patch changes the parser to defer rejecting qualified constructors so that the same Sema logic can apply to constructors as regular member functions. This also improves the error message when MS extensions are disabled (in my opinion). Before it was:
> 
> /Users/jason/Desktop/test.cpp:2:8: error: expected member name or ';' after declaration specifiers
>  A::A();
>  ~~~~ ^
> 1 error generated.
> 
> After:
> 
> /Users/jason/Desktop/test.cpp:2:6: error: extra qualification on member 'A'
>  A::A();
>  ~~~^
> 1 error generated.
> 
> All tests pass and I added one additional test for this case.
> 
> Jason
> 
> <over-qualified-ctor.diff>


_______________________________________________
cfe-commits mailing list
cfe-commits at cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits







More information about the cfe-commits mailing list