[clang] 814141f - Remove `noexcept` from ac49500cd0484e1b2dcf37fa4c0dade6f113c2c9 to fix bots

Duncan P. N. Exon Smith via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 30 13:31:58 PDT 2020


Author: Duncan P. N. Exon Smith
Date: 2020-10-30T16:29:16-04:00
New Revision: 814141f9bd0a64bbedae05773972d140f04f654d

URL: https://github.com/llvm/llvm-project/commit/814141f9bd0a64bbedae05773972d140f04f654d
DIFF: https://github.com/llvm/llvm-project/commit/814141f9bd0a64bbedae05773972d140f04f654d.diff

LOG: Remove `noexcept` from ac49500cd0484e1b2dcf37fa4c0dade6f113c2c9 to fix bots

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;
                                              ^~
```

Added: 
    

Modified: 
    clang/include/clang/Basic/FileEntry.h

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Basic/FileEntry.h b/clang/include/clang/Basic/FileEntry.h
index 2d7694ece999..7f5efb1c48f3 100644
--- a/clang/include/clang/Basic/FileEntry.h
+++ b/clang/include/clang/Basic/FileEntry.h
@@ -171,8 +171,7 @@ template <> class OptionalStorage<clang::FileEntryRef> {
 
 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 @@ template <> class OptionalStorage<clang::FileEntryRef> {
   explicit OptionalStorage(in_place_t, ArgTypes &&...Args)
       : MaybeRef(std::forward<ArgTypes>(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<FileEntryRef> {
 public:
-  OptionalFileEntryRefDegradesToFileEntryPtr() noexcept = default;
+  OptionalFileEntryRefDegradesToFileEntryPtr() = default;
   OptionalFileEntryRefDegradesToFileEntryPtr(
       OptionalFileEntryRefDegradesToFileEntryPtr &&) = default;
   OptionalFileEntryRefDegradesToFileEntryPtr(


        


More information about the cfe-commits mailing list