From 814141f9bd0a64bbedae05773972d140f04f654d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Duncan=20P=2E=20N=2E=20Exon=C2=A0Smith?= Date: Fri, 30 Oct 2020 16:29:16 -0400 Subject: [PATCH] Remove `noexcept` from ac49500cd0484e1b2dcf37fa4c0dade6f113c2c9 to fix bots MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit I'm having trouble with bots today. Remove more cargo-cult from the generic version of `OptionalStorage` that is failing on some (fewer) bots (but not locally). I expect this will fix: ``` FAILED: tools/clang/unittests/Basic/CMakeFiles/BasicTests.dir/FileEntryTest.cpp.o /usr/bin/c++ -DGTEST_HAS_RTTI=0 -DGTEST_HAS_TR1_TUPLE=0 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools/clang/unittests/Basic -I/home/buildbots/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/clang/unittests/Basic -I/home/buildbots/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/clang/include -Itools/clang/include -Iinclude -I/home/buildbots/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/include -I/home/buildbots/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/utils/unittest/googletest/include -I/home/buildbots/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/utils/unittest/googlemock/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -O3 -Wno-variadic-macros -fno-exceptions -fno-rtti -UNDEBUG -Wno-suggest-override -std=c++14 -MD -MT tools/clang/unittests/Basic/CMakeFiles/BasicTests.dir/FileEntryTest.cpp.o -MF tools/clang/unittests/Basic/CMakeFiles/BasicTests.dir/FileEntryTest.cpp.o.d -o tools/clang/unittests/Basic/CMakeFiles/BasicTests.dir/FileEntryTest.cpp.o -c /home/buildbots/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/clang/unittests/Basic/FileEntryTest.cpp /home/buildbots/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/clang/unittests/Basic/FileEntryTest.cpp: In member function ‘virtual void {anonymous}::FileEntryTest_OptionalFileEntryRefDegradesToFileEntryPtr_Test::TestBody()’: /home/buildbots/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/clang/unittests/Basic/FileEntryTest.cpp:48:46: error: use of deleted function ‘constexpr clang::OptionalFileEntryRefDegradesToFileEntryPtr::OptionalFileEntryRefDegradesToFileEntryPtr()’ OptionalFileEntryRefDegradesToFileEntryPtr M0; ^~ In file included from /home/buildbots/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/clang/unittests/Basic/FileEntryTest.cpp:9: /home/buildbots/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/clang/include/clang/Basic/FileEntry.h:250:3: note: ‘constexpr clang::OptionalFileEntryRefDegradesToFileEntryPtr::OptionalFileEntryRefDegradesToFileEntryPtr() noexcept’ is implicitly deleted because its exception-specification does not match the implicit exception-specification ‘’ OptionalFileEntryRefDegradesToFileEntryPtr() noexcept = default; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/buildbots/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/clang/unittests/Basic/FileEntryTest.cpp: In member function ‘virtual void {anonymous}::FileEntryTest_equals_Test::TestBody()’: /home/buildbots/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/clang/unittests/Basic/FileEntryTest.cpp:82:46: error: use of deleted function ‘constexpr clang::OptionalFileEntryRefDegradesToFileEntryPtr::OptionalFileEntryRefDegradesToFileEntryPtr()’ OptionalFileEntryRefDegradesToFileEntryPtr M0; ^~ ``` --- clang/include/clang/Basic/FileEntry.h | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/clang/include/clang/Basic/FileEntry.h b/clang/include/clang/Basic/FileEntry.h index 2d7694e..7f5efb1 100644 --- a/clang/include/clang/Basic/FileEntry.h +++ b/clang/include/clang/Basic/FileEntry.h @@ -171,8 +171,7 @@ template <> class OptionalStorage { public: ~OptionalStorage() = default; - OptionalStorage() noexcept - : MaybeRef(clang::FileEntryRef::optional_none_tag()) {} + OptionalStorage() : MaybeRef(clang::FileEntryRef::optional_none_tag()) {} OptionalStorage(OptionalStorage const &Other) = default; OptionalStorage(OptionalStorage &&Other) = default; OptionalStorage &operator=(OptionalStorage const &Other) = default; @@ -182,20 +181,20 @@ public: explicit OptionalStorage(in_place_t, ArgTypes &&...Args) : MaybeRef(std::forward(Args)...) {} - void reset() noexcept { MaybeRef = clang::FileEntryRef::optional_none_tag(); } + void reset() { MaybeRef = clang::FileEntryRef::optional_none_tag(); } - bool hasValue() const noexcept { return MaybeRef.hasOptionalValue(); } + bool hasValue() const { return MaybeRef.hasOptionalValue(); } - clang::FileEntryRef &getValue() LLVM_LVALUE_FUNCTION noexcept { + clang::FileEntryRef &getValue() LLVM_LVALUE_FUNCTION { assert(hasValue()); return MaybeRef; } - clang::FileEntryRef const &getValue() const LLVM_LVALUE_FUNCTION noexcept { + clang::FileEntryRef const &getValue() const LLVM_LVALUE_FUNCTION { assert(hasValue()); return MaybeRef; } #if LLVM_HAS_RVALUE_REFERENCE_THIS - clang::FileEntryRef &&getValue() &&noexcept { + clang::FileEntryRef &&getValue() && { assert(hasValue()); return std::move(MaybeRef); } @@ -247,7 +246,7 @@ namespace clang { class OptionalFileEntryRefDegradesToFileEntryPtr : public Optional { public: - OptionalFileEntryRefDegradesToFileEntryPtr() noexcept = default; + OptionalFileEntryRefDegradesToFileEntryPtr() = default; OptionalFileEntryRefDegradesToFileEntryPtr( OptionalFileEntryRefDegradesToFileEntryPtr &&) = default; OptionalFileEntryRefDegradesToFileEntryPtr( -- 2.7.4