<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Mar 5, 2014 at 7:01 AM, Nico Rieck <span dir="ltr"><<a href="mailto:nico.rieck@gmail.com" target="_blank">nico.rieck@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On 04.03.2014 03:36, Richard Smith wrote:<br>
> I'm concerned that you may be updating the storage class too late; at the<br>
> point where you update the storage class, it's already been used for<br>
> several things. Can you move this earlier? (I expect this won't be trivial<br>
> since you can't just look for an attribute because you won't have a Decl<br>
> yet...)<br>
<br>
</div>Looking at the code, the main issue seems to be that such a variable<br>
would get the wrong DeclContext because<br>
adjustContextForLocalExternDecl() is never called. This seems really ugly.<br>
<br>
I could for this special cause check the parsed attributes for dllimport<br>
(the only checking done when creating a DLLImportAttr is for valid<br>
subjects, so this is fulfilled).<br>
<br>
Do you have an idea what could go wrong when the DeclContext is not<br>
adjusted? Since the current tests don't expose this. Maybe it's possible<br>
to provoke wrong behavior but I've been unsuccessful so far.</blockquote><div><br></div><div>If we don't adjust the DeclContext, I don't think we'll reject ill-formed code such as this:</div><div><br></div>
<div>float x;<br></div><div>void f() {</div><div>   __declspec(dllimport) int x;</div><div>}</div></div></div></div>