<div dir="ltr"><div>This is wrong:</div><div><br></div><div>               if(type->isRecordType())</div><div>               {</div><div>                  const RecordType *asRecordType = static_cast<const RecordType*>(type);<br></div><div><br></div><div>Your Type is not necessarily a RecordType here; it might be a typedef for a record type or some other type sugar node. The right way to write this is:</div><div><br></div><div><div>               if (const RecordType *asRecordType = type->getAs<RecordType>())</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 4, 2015 at 3:15 PM, Jeff Waller <span dir="ltr"><<a href="mailto:truthset@gmail.com" target="_blank">truthset@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 style="word-wrap:break-word"><pre style="white-space:pre-wrap"><br></pre><pre style="white-space:pre-wrap">A cross-post from cfe-users. I think there will be no luck</pre><pre style="white-space:pre-wrap">on that list.</pre><pre style="white-space:pre-wrap">=======================</pre><pre style="white-space:pre-wrap">I’m getting the failure:

void clang::RecordDecl::LoadFieldsFromExternalStorage() const: Assertion `hasExternalLexicalStorage() && Source && "No external storage?"' failed.
when trying to iterate over a RecordDecl and not sure even what’s going on let along how to deal with it:

I’m proceeding from the example in
<a href="http://clang.llvm.org/docs/LibASTMatchersTutorial.html" target="_blank">http://clang.llvm.org/docs/LibASTMatchersTutorial.html</a>

Here is some context:
<a href="https://gist.github.com/waTeim/8757662c445ce3b4084f" target="_blank">https://gist.github.com/waTeim/8757662c445ce3b4084f</a>

Thanks in advance for any help</pre><div><br></div></div><br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>