<div><div>+    if (!AT->isSugared())</div><div>+      break;</div><div>+</div><div>+    Desugared = AT->desugar();</div></div><div><br></div>Please call AttributedType::getEquivalentType() rather than desugar(), and don't call AT->isSugared() (it always returns true).<div>
<br></div><div><br></div><div><div>+  QualType origType = Type;</div><div>+  Type = S.Context.getAttributedType(TAK, origType, Type);</div><div>+  return false;</div><div><br></div><div>Should be "OrigType", but why not just pass Type in directly?</div>
<div><br></div><div>With those two tweaks, LGTM</div><br><div class="gmail_quote">On Wed, May 22, 2013 at 2:34 PM, Aaron Ballman <span dir="ltr"><<a href="mailto:aaron@aaronballman.com" target="_blank">aaron@aaronballman.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Here is the updated patch with your suggestions applied.<br>
<br>
Thanks!<br>
<span class="HOEnZb"><font color="#888888"><br>
~Aaron<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Wed, May 22, 2013 at 4:45 PM, Aaron Ballman <<a href="mailto:aaron@aaronballman.com">aaron@aaronballman.com</a>> wrote:<br>
> On Wed, May 22, 2013 at 4:39 PM, Richard Smith <<a href="mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</a>> wrote:<br>
>> On Wed, May 22, 2013 at 1:34 PM, Aaron Ballman <<a href="mailto:aaron@aaronballman.com">aaron@aaronballman.com</a>><br>
>> wrote:<br>
>>><br>
>>> On Wed, May 22, 2013 at 3:59 PM, Richard Smith <<a href="mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</a>><br>
>>> wrote:<br>
>>> > +  // Pointer type qualifiers can only operate on pointer types, but not<br>
>>> > +  // pointer-to-member types.<br>
>>> > +  if (!Type->isPointerType() || Type->isMemberPointerType()) {<br>
>>> ><br>
>>> > You don't need the isMemberPointerType here.<br>
>>><br>
>>> Removed.<br>
>>><br>
>>> > This will still accept cases like:<br>
>>> ><br>
>>> > typedef int *P;<br>
>>> > P __ptr32 myp;<br>
>>> ><br>
>>> > I would suggest checking isa<PointerType> on the type you get after<br>
>>> > stripping off AttributedTypes.<br>
>>><br>
>>> I had an explicit test case in to ensure that worked because I felt it<br>
>>> was a reasonable use case.  Are you saying we should not allow it?<br>
>><br>
>><br>
>> You said this was illegal in MSVC, so I don't see why we should allow it.<br>
><br>
> MSVC isn't particularly consistent with what it allows and disallows.<br>
> ;-)  But I'll remove it just the same.<br>
><br>
> Thanks!<br>
><br>
> ~Aaron<br>
</div></div></blockquote></div><br></div>