<div class="gmail_extra">This fixes a C++11 crash-on-valid. Requesting a port to the branch!<br><br><div class="gmail_quote">On Wed, Apr 25, 2012 at 8:16 PM, Richard Smith <span dir="ltr"><<a href="mailto:richard-llvm@metafoo.co.uk" target="_blank">richard-llvm@metafoo.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: rsmith<br>
Date: Wed Apr 25 22:16:45 2012<br>
New Revision: 155608<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=155608&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=155608&view=rev</a><br>
Log:<br>
PR12660: Don't crash when initializing a const reference from a braced init list<br>
which creates a temporary by calling a constructor.<br>
<br>
Modified:<br>
    cfe/trunk/include/clang/Sema/Initialization.h<br>
    cfe/trunk/test/SemaCXX/cxx0x-initializer-references.cpp<br>
<br>
Modified: cfe/trunk/include/clang/Sema/Initialization.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Initialization.h?rev=155608&r1=155607&r2=155608&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Initialization.h?rev=155608&r1=155607&r2=155608&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/include/clang/Sema/Initialization.h (original)<br>
+++ cfe/trunk/include/clang/Sema/Initialization.h Wed Apr 25 22:16:45 2012<br>
@@ -225,7 +225,9 @@<br>
<br>
   /// \brief Create the initialization entity for a temporary.<br>
   static InitializedEntity InitializeTemporary(QualType Type) {<br>
-    return InitializedEntity(EK_Temporary, SourceLocation(), Type);<br>
+    InitializedEntity Result(EK_Temporary, SourceLocation(), Type);<br>
+    Result.TypeInfo = 0;<br>
+    return Result;<br>
   }<br>
<br>
   /// \brief Create the initialization entity for a temporary.<br>
<br>
Modified: cfe/trunk/test/SemaCXX/cxx0x-initializer-references.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/cxx0x-initializer-references.cpp?rev=155608&r1=155607&r2=155608&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/cxx0x-initializer-references.cpp?rev=155608&r1=155607&r2=155608&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/test/SemaCXX/cxx0x-initializer-references.cpp (original)<br>
+++ cfe/trunk/test/SemaCXX/cxx0x-initializer-references.cpp Wed Apr 25 22:16:45 2012<br>
@@ -85,3 +85,8 @@<br>
       f({1, 2});<br>
   }<br>
 }<br>
+<br>
+namespace PR12660 {<br>
+  const int &i { 1 };<br>
+  struct S { S(int); } const &s { 2 };<br>
+}<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>