On Wed, Mar 5, 2014 at 7:01 AM, Nico Rieck <[email protected]> wrote:

> On 04.03.2014 03:36, Richard Smith wrote:
> > I'm concerned that you may be updating the storage class too late; at the
> > point where you update the storage class, it's already been used for
> > several things. Can you move this earlier? (I expect this won't be
> trivial
> > since you can't just look for an attribute because you won't have a Decl
> > yet...)
>
> Looking at the code, the main issue seems to be that such a variable
> would get the wrong DeclContext because
> adjustContextForLocalExternDecl() is never called. This seems really ugly.
>
> I could for this special cause check the parsed attributes for dllimport
> (the only checking done when creating a DLLImportAttr is for valid
> subjects, so this is fulfilled).
>
> Do you have an idea what could go wrong when the DeclContext is not
> adjusted? Since the current tests don't expose this. Maybe it's possible
> to provoke wrong behavior but I've been unsuccessful so far.


If we don't adjust the DeclContext, I don't think we'll reject ill-formed
code such as this:

float x;
void f() {
   __declspec(dllimport) int x;
}
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to