On Fri, May 17, 2013 at 3:50 PM, Rafael Espíndola <
[email protected]> wrote:

> On 17 May 2013 15:44, Reid Kleckner <[email protected]> wrote:
> > MSVC accepts
> >
> > static int x7;
> > extern __declspec(selectany) int x7;
> >
> > But it also accepts
> >
> > static int x7;
> > extern int x7;
>
> It should, we also do :-)
>
> In the case with __declspec(selectany), is x7 transformed into a
> externally visible symbol or the attribute just ignored?


Oh.  Looks like it's externally visible and comdat.  Looks like it needs
work to accept it after initial definitions or something.

> That seems like a separate issue.  It doesn't seem that important to me to
> > accept this.
> >
> > Clang errors out with 'attribute declaration must precede definition',
> which
> > doesn't seem useful to have in that test.
>
> It is nice to have a test that there in an error, just to make sure we
> don't extend a microsoft extension.


OK.


> > OK to commit as is?
>
> OK with the test. There is a discussion on weak_odr being the correct
> linkage, but changing to _odr (if appropriate), just enables more
> optimizations and can be a followup patch.
>

The code you sent returns 5 directly with optimizations, so does that mean
I can go with weak_odr?
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to