<div dir="ltr">There is no code in the MS Record Layout builder to handle external sources so the behavior is unlikely to be correct in the case of an external source (hence the guard).  I don't know anything about how PCH works or interacts with clang on windows.  I'll try to get a better answer for you but in the time being I'd suggest not using PCH and clang on windows in combination.<div>
<br></div><div>-Warren</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Feb 6, 2014 at 4:23 PM, Will Wilson <span dir="ltr"><<a href="mailto:will@indefiant.com" target="_blank">will@indefiant.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Warren,<div><br></div><div>I've just been hunting a bug in MS mode where records were being given different layouts depending on if the TU was built with a PCH or not. In the end I tracked it down to <span>ASTContext</span><span>::</span>getASTRecordLayout() introduced in r192494:</div>









<div><br></div><div><div class=""><div>  if (isMsLayout(D) && !D->getASTContext().getExternalSource()) {</div></div><div>    NewEntry = BuildMicrosoftASTRecordLayout(D);</div></div><div><br></div><div>Removing the "&& !D->getASTContext().getExternalSource()" restored the expected behaviour. Is this check still needed?</div>

<div><br></div><div>Cheers,</div><div>Will.</div></div>
</blockquote></div><br></div>