<div dir="ltr">Hi,<div><br></div><div>I've reverted this in r368985 to get the Windows bots green again.</div><div><br></div><div>Regards</div><div>Russ</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 15 Aug 2019 at 07:54, via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
The test that was added in this change with the removal of the LLVM_HAS_RVALUE_REFERENCE_THIS seems to be failing with run on Windows:<br>
<br>
<a href="http://lab.llvm.org:8011/builders/llvm-clang-x86_64-win-fast/builds/2727" rel="noreferrer" target="_blank">http://lab.llvm.org:8011/builders/llvm-clang-x86_64-win-fast/builds/2727</a><br>
FAIL: LLVM-Unit :: ADT/./ADTTests.exe/OptionalTest.MoveGetValueOr (535 of 3846)<br>
******************** TEST 'LLVM-Unit :: ADT/./ADTTests.exe/OptionalTest.MoveGetValueOr' FAILED ********************<br>
Note: Google Test filter = OptionalTest.MoveGetValueOr<br>
<br>
[==========] Running 1 test from 1 test case.<br>
<br>
[----------] Global test environment set-up.<br>
<br>
[----------] 1 test from OptionalTest<br>
<br>
[ RUN ] OptionalTest.MoveGetValueOr<br>
<br>
C:\buildbot\as-builder-3\llvm-clang-x86_64-win-fast\llvm\unittests\ADT\OptionalTest.cpp(390): error: Expected: 1u<br>
<br>
Which is: 1<br>
<br>
To be equal to: MoveOnly::MoveConstructions<br>
<br>
Which is: 2<br>
<br>
C:\buildbot\as-builder-3\llvm-clang-x86_64-win-fast\llvm\unittests\ADT\OptionalTest.cpp(392): error: Expected: 2u<br>
<br>
Which is: 2<br>
<br>
To be equal to: MoveOnly::Destructions<br>
<br>
Which is: 3<br>
<br>
C:\buildbot\as-builder-3\llvm-clang-x86_64-win-fast\llvm\unittests\ADT\OptionalTest.cpp(397): error: Expected: 1u<br>
<br>
Which is: 1<br>
<br>
To be equal to: MoveOnly::MoveConstructions<br>
<br>
Which is: 2<br>
<br>
C:\buildbot\as-builder-3\llvm-clang-x86_64-win-fast\llvm\unittests\ADT\OptionalTest.cpp(399): error: Expected: 2u<br>
<br>
Which is: 2<br>
<br>
To be equal to: MoveOnly::Destructions<br>
<br>
Which is: 3<br>
<br>
[ FAILED ] OptionalTest.MoveGetValueOr (0 ms)<br>
<br>
[----------] 1 test from OptionalTest (0 ms total)<br>
<br>
<br>
<br>
[----------] Global test environment tear-down<br>
<br>
[==========] 1 test from 1 test case ran. (0 ms total)<br>
<br>
[ PASSED ] 0 tests.<br>
<br>
[ FAILED ] 1 test, listed below:<br>
<br>
[ FAILED ] OptionalTest.MoveGetValueOr<br>
<br>
<br>
<br>
1 FAILED TEST<br>
<br>
Can you take a look?<br>
<br>
Douglas Yung<br>
<br>
-----Original Message-----<br>
From: llvm-commits <<a href="mailto:llvm-commits-bounces@lists.llvm.org" target="_blank">llvm-commits-bounces@lists.llvm.org</a>> On Behalf Of JF Bastien via llvm-commits<br>
Sent: Wednesday, August 14, 2019 15:48<br>
To: <a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
Subject: [llvm] r368939 - Remove LVALUE / RVALUE workarounds<br>
<br>
Author: jfb<br>
Date: Wed Aug 14 15:48:12 2019<br>
New Revision: 368939<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=368939&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=368939&view=rev</a><br>
Log:<br>
Remove LVALUE / RVALUE workarounds<br>
<br>
Summary: LLVM_HAS_RVALUE_REFERENCE_THIS and LLVM_LVALUE_FUNCTION shouldn't be needed anymore because the minimum compiler versions support them.<br>
<br>
Subscribers: jkorous, dexonsmith, cfe-commits, llvm-commits, hans, thakis, chandlerc, rnk<br>
<br>
Tags: #clang, #llvm<br>
<br>
Differential Revision: <a href="https://reviews.llvm.org/D66240" rel="noreferrer" target="_blank">https://reviews.llvm.org/D66240</a><br>
<br>
Modified:<br>
llvm/trunk/include/llvm/ADT/Optional.h<br>
llvm/trunk/include/llvm/Support/Compiler.h<br>
llvm/trunk/unittests/ADT/OptionalTest.cpp<br>
<br>
Modified: llvm/trunk/include/llvm/ADT/Optional.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/Optional.h?rev=368939&r1=368938&r2=368939&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/Optional.h?rev=368939&r1=368938&r2=368939&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/ADT/Optional.h (original)<br>
+++ llvm/trunk/include/llvm/ADT/Optional.h Wed Aug 14 15:48:12 2019<br>
@@ -69,20 +69,18 @@ public:<br>
<br>
bool hasValue() const noexcept { return hasVal; }<br>
<br>
- T &getValue() LLVM_LVALUE_FUNCTION noexcept {<br>
+ T &getValue() & noexcept {<br>
assert(hasVal);<br>
return value;<br>
}<br>
- T const &getValue() const LLVM_LVALUE_FUNCTION noexcept {<br>
+ T const &getValue() const & noexcept {<br>
assert(hasVal);<br>
return value;<br>
}<br>
-#if LLVM_HAS_RVALUE_REFERENCE_THIS<br>
T &&getValue() && noexcept {<br>
assert(hasVal);<br>
return std::move(value);<br>
}<br>
-#endif<br>
<br>
template <class... Args> void emplace(Args &&... args) {<br>
reset();<br>
@@ -169,20 +167,19 @@ public:<br>
<br>
bool hasValue() const noexcept { return hasVal; }<br>
<br>
- T &getValue() LLVM_LVALUE_FUNCTION noexcept {<br>
+ T &getValue() & noexcept {<br>
assert(hasVal);<br>
return value;<br>
}<br>
- T const &getValue() const LLVM_LVALUE_FUNCTION noexcept {<br>
+ T const &getValue() const & noexcept {<br>
assert(hasVal);<br>
return value;<br>
}<br>
-#if LLVM_HAS_RVALUE_REFERENCE_THIS<br>
+<br>
T &&getValue() && noexcept {<br>
assert(hasVal);<br>
return std::move(value);<br>
}<br>
-#endif<br>
<br>
template <class... Args> void emplace(Args &&... args) {<br>
reset();<br>
@@ -252,22 +249,21 @@ public:<br>
<br>
const T *getPointer() const { return &Storage.getValue(); }<br>
T *getPointer() { return &Storage.getValue(); }<br>
- const T &getValue() const LLVM_LVALUE_FUNCTION { return Storage.getValue(); }<br>
- T &getValue() LLVM_LVALUE_FUNCTION { return Storage.getValue(); }<br>
+ const T &getValue() const & { return Storage.getValue(); } T <br>
+ &getValue() & { return Storage.getValue(); }<br>
<br>
explicit operator bool() const { return hasValue(); }<br>
bool hasValue() const { return Storage.hasValue(); }<br>
const T *operator->() const { return getPointer(); }<br>
T *operator->() { return getPointer(); }<br>
- const T &operator*() const LLVM_LVALUE_FUNCTION { return getValue(); }<br>
- T &operator*() LLVM_LVALUE_FUNCTION { return getValue(); }<br>
+ const T &operator*() const & { return getValue(); } T &operator*() & <br>
+ { return getValue(); }<br>
<br>
template <typename U><br>
- constexpr T getValueOr(U &&value) const LLVM_LVALUE_FUNCTION {<br>
+ constexpr T getValueOr(U &&value) const & {<br>
return hasValue() ? getValue() : std::forward<U>(value);<br>
}<br>
<br>
-#if LLVM_HAS_RVALUE_REFERENCE_THIS<br>
T &&getValue() && { return std::move(Storage.getValue()); }<br>
T &&operator*() && { return std::move(Storage.getValue()); }<br>
<br>
@@ -275,7 +271,6 @@ public:<br>
T getValueOr(U &&value) && {<br>
return hasValue() ? std::move(getValue()) : std::forward<U>(value);<br>
}<br>
-#endif<br>
};<br>
<br>
template <typename T, typename U><br>
<br>
Modified: llvm/trunk/include/llvm/Support/Compiler.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Compiler.h?rev=368939&r1=368938&r2=368939&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Compiler.h?rev=368939&r1=368938&r2=368939&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Support/Compiler.h (original)<br>
+++ llvm/trunk/include/llvm/Support/Compiler.h Wed Aug 14 15:48:12 2019<br>
@@ -83,26 +83,6 @@<br>
#define LLVM_MSC_PREREQ(version) 0<br>
#endif<br>
<br>
-/// Does the compiler support ref-qualifiers for *this?<br>
-///<br>
-/// Sadly, this is separate from just rvalue reference support because GCC -/// and MSVC implemented this later than everything else.<br>
-#if __has_feature(cxx_rvalue_references) || LLVM_GNUC_PREREQ(4, 8, 1) -#define LLVM_HAS_RVALUE_REFERENCE_THIS 1 -#else -#define LLVM_HAS_RVALUE_REFERENCE_THIS 0 -#endif<br>
-<br>
-/// Expands to '&' if ref-qualifiers for *this are supported.<br>
-///<br>
-/// This can be used to provide lvalue/rvalue overrides of member functions.<br>
-/// The rvalue override should be guarded by LLVM_HAS_RVALUE_REFERENCE_THIS -#if LLVM_HAS_RVALUE_REFERENCE_THIS -#define LLVM_LVALUE_FUNCTION & -#else -#define LLVM_LVALUE_FUNCTION -#endif<br>
-<br>
/// LLVM_LIBRARY_VISIBILITY - If a class marked with this attribute is linked /// into a shared library, then the class should be private to the library and /// not accessible from outside it. Can also be used to mark variables and<br>
<br>
Modified: llvm/trunk/unittests/ADT/OptionalTest.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/OptionalTest.cpp?rev=368939&r1=368938&r2=368939&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/OptionalTest.cpp?rev=368939&r1=368938&r2=368939&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/unittests/ADT/OptionalTest.cpp (original)<br>
+++ llvm/trunk/unittests/ADT/OptionalTest.cpp Wed Aug 14 15:48:12 2019<br>
@@ -382,8 +382,6 @@ TEST_F(OptionalTest, ImmovableEmplace) {<br>
EXPECT_EQ(0u, Immovable::Destructions); }<br>
<br>
-#if LLVM_HAS_RVALUE_REFERENCE_THIS<br>
-<br>
TEST_F(OptionalTest, MoveGetValueOr) {<br>
Optional<MoveOnly> A;<br>
<br>
@@ -401,8 +399,6 @@ TEST_F(OptionalTest, MoveGetValueOr) {<br>
EXPECT_EQ(2u, MoveOnly::Destructions); }<br>
<br>
-#endif // LLVM_HAS_RVALUE_REFERENCE_THIS<br>
-<br>
struct EqualTo {<br>
template <typename T, typename U> static bool apply(const T &X, const U &Y) {<br>
return X == Y;<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>