[clang] 894c0e9 - Revert "[Clang] Fix variant crashes from GH58028, GH57370"
Roy Jacobson via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 30 01:25:33 PDT 2022
Author: Roy Jacobson
Date: 2022-09-30T11:24:46+03:00
New Revision: 894c0e94f9c62413feef88fd577c430839abaea7
URL: https://github.com/llvm/llvm-project/commit/894c0e94f9c62413feef88fd577c430839abaea7
DIFF: https://github.com/llvm/llvm-project/commit/894c0e94f9c62413feef88fd577c430839abaea7.diff
LOG: Revert "[Clang] Fix variant crashes from GH58028, GH57370"
This reverts commit 9706bb3165f5e508d5e2247ad8a3f45077df546d, some CI workers complain about the test.
Added:
Modified:
clang/lib/Sema/SemaInit.cpp
Removed:
clang/test/SemaCXX/specialization-diagnose-crash.cpp
################################################################################
diff --git a/clang/lib/Sema/SemaInit.cpp b/clang/lib/Sema/SemaInit.cpp
index ee6fee0ac7324..7097b9deb8ed6 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 ceb3c4655f745..0000000000000
--- 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 <class T> using void_t = void;
-
-template <class T> struct X { T x; };
-
-template <class T1, class T2, class = void> struct Variant {
- Variant() = delete; // expected-note {{deleted here}}
-};
-
-template <class T1, class T2>
-struct Variant<T1, T2, void_t<decltype(X<T2>{T1()})>> {};
-
-void f() {
- Variant<V1, V1>();
- Variant<V1, V2>(); // expected-error {{call to deleted constructor}}
-}
More information about the cfe-commits
mailing list