<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>Fixed in r177336, thanks for reporting the issue!</div><div><br></div><div>-Argyrios</div><br><div><div>On Feb 27, 2013, at 8:00 PM, Tom Honermann <<a href="mailto:thonermann@coverity.com">thonermann@coverity.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">Here is another example test case. The diagnostic in this case is a warning, not an error.<br><br>$ cat t.cpp<br>template<typename T><br>struct S {<br> T *mf();<br>};<br>template<typename T><br>T *S<T>::mf() {<br> // warning: control reaches end of non-void function [-Wreturn-type]<br>}<br><br>void f() {<br> S<int>().mf();<br>}<br><br><br>I suspect the assertion failure occurs whenever a diagnostic is issued for a template instantiation in an AST file, but I haven't tried to prove this.<br><br>I added this example to the bug report as well.<br><br>Tom.<br><br>On 02/27/2013 03:35 PM, Tom Honermann wrote:<br><blockquote type="cite">This issue reproduces with Clang 3.2 and with Clang trunk as of yesterday.<br><br>The following bug has been filed for this:<br> Bug 15377 - Clang assertion failure when issuing a diagnostic while<br>compiling from an AST file<br> <a href="http://llvm.org/bugs/show_bug.cgi?id=15377">http://llvm.org/bugs/show_bug.cgi?id=15377</a><br><br>This code is ill-formed:<br><br>$ cat t.cpp<br>template<typename T><br>T tf() {<br> static const T i;<br> return i;<br>}<br><br>void f() {<br> tf<int>();<br>}<br><br><br>Compiling it directly to object file results in an appropriate diagnostic:<br><br>$ clang -c t.cpp<br>t.cpp:5:20: error: default initialization of an object of const type<br>'const int'<br> static const T i;<br> ^<br>t.cpp:10:5: note: in instantiation of function template specialization<br>'tf<int>'<br> requested here<br> tf<int>();<br> ^<br>1 error generated.<br><br><br>Emitting to an AST file and then compiling from it results in an<br>assertion failure when constructing the diagnostic:<br><br>$ clang -emit-ast t.cpp<br>$ clang -c t.ast<br>clang: lib/Frontend/TextDiagnosticPrinter.cpp:148: virtual void<br>clang::TextDiagnosticPrinter::HandleDiagnostic(clang::DiagnosticsEngine::Level,<br>const clang::Diagnostic&): Assertion `TextDiag && "Unexpected diagnostic<br>outside source file processing"' failed.<br>clang: error: unable to execute command: Segmentation fault (core dumped)<br>clang: error: clang frontend command failed due to signal (use -v to see<br>invocation)<br>clang version 3.2 (tags/RELEASE_32/final)<br>Target: x86_64-unknown-linux-gnu<br>Thread model: posix<br>clang: note: diagnostic msg: PLEASE submit a bug report to<br><a href="http://llvm.org/bugs/">http://llvm.org/bugs/</a> and include the crash backtrace, preprocessed<br>source, and associated run script.<br>clang: note: diagnostic msg: Error generating preprocessed source(s) -<br>no preprocessable inputs.<br><br>Backtrace and further information are available in the bug report.<br><br>Tom.<br><br>_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev<br><br></blockquote><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">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a></div></blockquote></div><br></body></html>