<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Nico,<div class=""><br class=""></div><div class="">the tests for ASTImporter (currently, test/ASTMerge) are currently set up to do an AST merge and check that certain errors occur.  I don’t believe they actually go and code-gen, which would have caught this.</div><div class=""><br class=""></div><div class="">I think investing in better ASTImporter testing is a great goal, but right now LLDB is actually the most comprehensive validation suite for the ASTImporter I’m aware of.</div><div class=""><br class=""></div><div class="">Sean</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 2, 2016, at 11:04 PM, Nico Weber <<a href="mailto:thakis@chromium.org" class="">thakis@chromium.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><p dir="ltr" class="">Is it possible to test this?</p>
<div class="gmail_quote">On Mar 2, 2016 6:26 PM, "Sean Callanan via cfe-commits" <<a href="mailto:cfe-commits@lists.llvm.org" class="">cfe-commits@lists.llvm.org</a>> wrote:<br type="attribution" class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: spyffe<br class="">
Date: Wed Mar  2 20:22:05 2016<br class="">
New Revision: 262576<br class="">
<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=262576&view=rev" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project?rev=262576&view=rev</a><br class="">
Log:<br class="">
Caught and fixed a typo in r262572.<br class="">
<br class="">
I should have checked and imported D's in-class initializer.<br class="">
Instead I accidentally used ToField's in-class initializer,<br class="">
which is always NULL so ToField will never get one.<br class="">
<br class="">
<<a href="rdar://problem/24943405" class="">rdar://problem/24943405</a>><br class="">
<br class="">
Modified:<br class="">
    cfe/trunk/lib/AST/ASTImporter.cpp<br class="">
<br class="">
Modified: cfe/trunk/lib/AST/ASTImporter.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTImporter.cpp?rev=262576&r1=262575&r2=262576&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTImporter.cpp?rev=262576&r1=262575&r2=262576&view=diff</a><br class="">
==============================================================================<br class="">
--- cfe/trunk/lib/AST/ASTImporter.cpp (original)<br class="">
+++ cfe/trunk/lib/AST/ASTImporter.cpp Wed Mar  2 20:22:05 2016<br class="">
@@ -3038,7 +3038,7 @@ Decl *ASTNodeImporter::VisitFieldDecl(Fi<br class="">
                                          D->getInClassInitStyle());<br class="">
   ToField->setAccess(D->getAccess());<br class="">
   ToField->setLexicalDeclContext(LexicalDC);<br class="">
-  if (Expr *FromInitializer = ToField->getInClassInitializer()) {<br class="">
+  if (Expr *FromInitializer = D->getInClassInitializer()) {<br class="">
     Expr *ToInitializer = Importer.Import(FromInitializer);<br class="">
     if (ToInitializer)<br class="">
       ToField->setInClassInitializer(ToInitializer);<br class="">
<br class="">
<br class="">
_______________________________________________<br class="">
cfe-commits mailing list<br class="">
<a href="mailto:cfe-commits@lists.llvm.org" class="">cfe-commits@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br class="">
</blockquote></div>
</div></blockquote></div><br class=""></div></body></html>