From 894c0e94f9c62413feef88fd577c430839abaea7 Mon Sep 17 00:00:00 2001 From: Roy Jacobson Date: Fri, 30 Sep 2022 11:24:46 +0300 Subject: [PATCH] Revert "[Clang] Fix variant crashes from GH58028, GH57370" This reverts commit 9706bb3165f5e508d5e2247ad8a3f45077df546d, some CI workers complain about the test. --- clang/lib/Sema/SemaInit.cpp | 8 ++++---- .../test/SemaCXX/specialization-diagnose-crash.cpp | 24 ---------------------- 2 files changed, 4 insertions(+), 28 deletions(-) delete mode 100644 clang/test/SemaCXX/specialization-diagnose-crash.cpp diff --git a/clang/lib/Sema/SemaInit.cpp b/clang/lib/Sema/SemaInit.cpp index ee6fee0..7097b9d 100644 --- a/clang/lib/Sema/SemaInit.cpp +++ b/clang/lib/Sema/SemaInit.cpp @@ -695,10 +695,10 @@ void InitListChecker::FillInEmptyInitForField(unsigned Init, FieldDecl *Field, // member of reference type uninitialized, the program is // ill-formed. SemaRef.Diag(Loc, diag::err_init_reference_member_uninitialized) - << Field->getType() - << (ILE->isSyntacticForm() ? ILE : ILE->getSyntacticForm()) - ->getSourceRange(); - SemaRef.Diag(Field->getLocation(), diag::note_uninit_reference_member); + << Field->getType() + << ILE->getSyntacticForm()->getSourceRange(); + SemaRef.Diag(Field->getLocation(), + diag::note_uninit_reference_member); } hadError = true; return; diff --git a/clang/test/SemaCXX/specialization-diagnose-crash.cpp b/clang/test/SemaCXX/specialization-diagnose-crash.cpp deleted file mode 100644 index ceb3c46..0000000 --- a/clang/test/SemaCXX/specialization-diagnose-crash.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// RUN: %clang_cc1 -fsyntax-only %s -verify -// This is a reduction of GH57370 and GH58028, originally appearing -// in libstdc++'s variant code. - -struct V1 {}; -struct V2 : V1 { - int &a; -}; - -template using void_t = void; - -template struct X { T x; }; - -template struct Variant { - Variant() = delete; // expected-note {{deleted here}} -}; - -template -struct Variant{T1()})>> {}; - -void f() { - Variant(); - Variant(); // expected-error {{call to deleted constructor}} -} -- 2.7.4