<div dir="ltr">Generally I'd expect a test case to exercise/demonstrate the behavior that was previously hidden behind an assertion. (put another way: "we expect something specific to happen, not just for clang not to assert/crash")</div><br><div class="gmail_quote"><div dir="ltr">On Mon, Aug 22, 2016 at 3:32 PM Adrian Prantl via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: adrian<br>
Date: Mon Aug 22 17:23:58 2016<br>
New Revision: 279485<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=279485&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=279485&view=rev</a><br>
Log:<br>
Module debug info: Don't assert when encountering an incomplete definition<br>
in isDefinedInClangModule() and assume that the incomplete definition<br>
is not defined in the module.<br>
<br>
This broke the -gmodules self host recently.<br>
rdar://problem/27894367<br>
<br>
Added:<br>
cfe/trunk/test/Modules/Inputs/DebugNestedA.h<br>
cfe/trunk/test/Modules/Inputs/DebugNestedB.h<br>
Modified:<br>
cfe/trunk/lib/CodeGen/CGDebugInfo.cpp<br>
cfe/trunk/test/Modules/Inputs/module.map<br>
<br>
Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=279485&r1=279484&r2=279485&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=279485&r1=279484&r2=279485&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Mon Aug 22 17:23:58 2016<br>
@@ -1655,7 +1655,8 @@ static bool isDefinedInClangModule(const<br>
if (!RD->isExternallyVisible() && RD->getName().empty())<br>
return false;<br>
if (auto *CXXDecl = dyn_cast<CXXRecordDecl>(RD)) {<br>
- assert(CXXDecl->isCompleteDefinition() && "incomplete record definition");<br>
+ if (!CXXDecl->isCompleteDefinition())<br>
+ return false;<br>
auto TemplateKind = CXXDecl->getTemplateSpecializationKind();<br>
if (TemplateKind != TSK_Undeclared) {<br>
// This is a template, check the origin of the first member.<br>
<br>
Added: cfe/trunk/test/Modules/Inputs/DebugNestedA.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/DebugNestedA.h?rev=279485&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/DebugNestedA.h?rev=279485&view=auto</a><br>
==============================================================================<br>
--- cfe/trunk/test/Modules/Inputs/DebugNestedA.h (added)<br>
+++ cfe/trunk/test/Modules/Inputs/DebugNestedA.h Mon Aug 22 17:23:58 2016<br>
@@ -0,0 +1,8 @@<br>
+/* -*- C++ -*- */<br>
+template <typename T> class Base {};<br>
+template <typename T> struct A : public Base<A<T>> {<br>
+ void f();<br>
+};<br>
+<br>
+class F {};<br>
+typedef A<F> AF;<br>
<br>
Added: cfe/trunk/test/Modules/Inputs/DebugNestedB.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/DebugNestedB.h?rev=279485&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/DebugNestedB.h?rev=279485&view=auto</a><br>
==============================================================================<br>
--- cfe/trunk/test/Modules/Inputs/DebugNestedB.h (added)<br>
+++ cfe/trunk/test/Modules/Inputs/DebugNestedB.h Mon Aug 22 17:23:58 2016<br>
@@ -0,0 +1,7 @@<br>
+/* -*- C++ -*- */<br>
+#include "DebugNestedA.h"<br>
+class C {<br>
+ void run(AF &af) {<br>
+ af.f();<br>
+ }<br>
+};<br>
<br>
Modified: cfe/trunk/test/Modules/Inputs/module.map<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/module.map?rev=279485&r1=279484&r2=279485&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/module.map?rev=279485&r1=279484&r2=279485&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/Modules/Inputs/module.map (original)<br>
+++ cfe/trunk/test/Modules/Inputs/module.map Mon Aug 22 17:23:58 2016<br>
@@ -422,3 +422,13 @@ module MacroFabs1 {<br>
module DiagOutOfDate {<br>
header "DiagOutOfDate.h"<br>
}<br>
+<br>
+module DebugNestedA {<br>
+ header "DebugNestedA.h"<br>
+ export *<br>
+}<br>
+<br>
+module DebugNestedB {<br>
+ header "DebugNestedB.h"<br>
+ export *<br>
+}<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div>