forked from OSchip/llvm-project
Fix a crasher in constructor-initializer reordering warnings (PR7179).
llvm-svn: 104299
This commit is contained in:
parent
c13a9e7382
commit
aabdfcb29e
|
@ -2016,9 +2016,7 @@ DiagnoseBaseOrMemInitializerOrder(Sema &SemaRef,
|
|||
// If we didn't find this initializer, it must be because we
|
||||
// scanned past it on a previous iteration. That can only
|
||||
// happen if we're out of order; emit a warning.
|
||||
if (IdealIndex == NumIdealInits) {
|
||||
assert(PrevInit && "initializer not found in initializer list");
|
||||
|
||||
if (IdealIndex == NumIdealInits && PrevInit) {
|
||||
Sema::SemaDiagnosticBuilder D =
|
||||
SemaRef.Diag(PrevInit->getSourceLocation(),
|
||||
diag::warn_initializer_out_of_order);
|
||||
|
|
|
@ -120,3 +120,13 @@ namespace test3 {
|
|||
};
|
||||
};
|
||||
}
|
||||
|
||||
namespace PR7179 {
|
||||
struct X
|
||||
{
|
||||
struct Y
|
||||
{
|
||||
template <class T> Y(T x) : X(x) { }
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue