diff options
author | Timothy Flynn <trflynn89@pm.me> | 2023-01-13 15:45:04 -0500 |
---|---|---|
committer | Tim Flynn <trflynn89@pm.me> | 2023-01-13 18:50:47 -0500 |
commit | 3de75f6436a1e729691a40c35e8e8a5be5aa2f41 (patch) | |
tree | 0e0b99944121ad5286562ad69606a912a7c4f0a5 /Userland/Libraries | |
parent | a59ebdac2d0445cfb35c899d4ff372e1518c2178 (diff) | |
download | serenity-3de75f6436a1e729691a40c35e8e8a5be5aa2f41.zip |
LibJS: Explicitly disallow references in ThrowCompletionOr
This will be disallowed by TRY soon, but the compile error produced by
this requirement will pinpoint the errant line more accurately.
Diffstat (limited to 'Userland/Libraries')
-rw-r--r-- | Userland/Libraries/LibJS/Forward.h | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Completion.h | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Forward.h b/Userland/Libraries/LibJS/Forward.h index 78bc0ce054..6e656ccfc4 100644 --- a/Userland/Libraries/LibJS/Forward.h +++ b/Userland/Libraries/LibJS/Forward.h @@ -7,6 +7,7 @@ #pragma once +#include <AK/Concepts.h> #include <AK/Types.h> #define JS_DECLARE_NATIVE_FUNCTION(name) \ @@ -282,6 +283,7 @@ struct PartialDurationRecord; }; template<typename T> +requires(!IsLvalueReference<T>) class ThrowCompletionOr; template<class T> diff --git a/Userland/Libraries/LibJS/Runtime/Completion.h b/Userland/Libraries/LibJS/Runtime/Completion.h index d1f226e647..0e36f3b8a0 100644 --- a/Userland/Libraries/LibJS/Runtime/Completion.h +++ b/Userland/Libraries/LibJS/Runtime/Completion.h @@ -246,6 +246,7 @@ private: namespace JS { template<typename ValueType> +requires(!IsLvalueReference<ValueType>) class [[nodiscard]] ThrowCompletionOr { public: ThrowCompletionOr() |