Commit 1dfc8e93 authored by Bill Wendling's avatar Bill Wendling
Browse files

Merging r155608:

------------------------------------------------------------------------
r155608 | rsmith | 2012-04-25 20:16:45 -0700 (Wed, 25 Apr 2012) | 3 lines

PR12660: Don't crash when initializing a const reference from a braced init list
which creates a temporary by calling a constructor.

------------------------------------------------------------------------

llvm-svn: 156678
parent 2bd85730
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -225,7 +225,9 @@ public:
  
  /// \brief Create the initialization entity for a temporary.
  static InitializedEntity InitializeTemporary(QualType Type) {
    return InitializedEntity(EK_Temporary, SourceLocation(), Type);
    InitializedEntity Result(EK_Temporary, SourceLocation(), Type);
    Result.TypeInfo = 0;
    return Result;
  }

  /// \brief Create the initialization entity for a temporary.
+5 −0
Original line number Diff line number Diff line
@@ -85,3 +85,8 @@ namespace PR12182 {
      f({1, 2});
  }
}

namespace PR12660 {
  const int &i { 1 };
  struct S { S(int); } const &s { 2 };
}