r174980 - Accept over-qualified constructor in MSVC emulation mode

Richard Smith richard at metafoo.co.uk
Tue Feb 12 12:10:59 PST 2013


On Tue, Feb 12, 2013 at 11:46 AM, Dmitri Gribenko <gribozavr at gmail.com>wrote:

> On Tue, Feb 12, 2013 at 9:44 PM, Richard Smith <richard at metafoo.co.uk>
> wrote:
> > OK, I think under the resolutions of core issue 1435 and particularly
> 1310,
> > the new behavior is correct. Please add a test for that!
>
> Will do.
>
> We also produced a weird AST for
> typedef int T;
> struct X { X::X(T()); };
>
> `-CXXRecordDecl 0x2f627a0 <line:2:1, col:23> struct X
>   |-CXXRecordDecl 0x2f628b0 <col:1, col:8> struct X
>   `-CXXMethodDecl 0x2f94fc0 <col:12, col:20> T 'struct X::X ((void))'
>

I think I'm missing what's weird here. We were interpreting this as
declaring a member function named T, and that's the right AST for that
interpretation.


> While if we removed the 'X::' qualification, we got:
>
> `-CXXRecordDecl 0x355a7a0 <line:2:1, col:20> struct X
>   |-CXXRecordDecl 0x355a8b0 <col:1, col:8> struct X
>   `-CXXConstructorDecl 0x358c050 <col:12, col:17> X 'void (T (*)(void))'
>     `-ParmVarDecl 0x355aa40 <col:14, col:16> 'T (*)(void)'
>
> Which looks correct.
>
> Dmitri
>
> --
> main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
> (j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130212/eab4896f/attachment.html>


More information about the cfe-commits mailing list