summaryrefslogtreecommitdiffstats
path: root/src/boost/libs/outcome/test/compile-fail
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 18:24:20 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 18:24:20 +0000
commit483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch)
treee5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /src/boost/libs/outcome/test/compile-fail
parentInitial commit. (diff)
downloadceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.tar.xz
ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.zip
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/boost/libs/outcome/test/compile-fail')
-rw-r--r--src/boost/libs/outcome/test/compile-fail/issue0071-fail.cpp37
-rw-r--r--src/boost/libs/outcome/test/compile-fail/outcome-int-int-1.cpp33
-rw-r--r--src/boost/libs/outcome/test/compile-fail/result-int-int-1.cpp33
-rw-r--r--src/boost/libs/outcome/test/compile-fail/result-int-int-2.cpp33
4 files changed, 136 insertions, 0 deletions
diff --git a/src/boost/libs/outcome/test/compile-fail/issue0071-fail.cpp b/src/boost/libs/outcome/test/compile-fail/issue0071-fail.cpp
new file mode 100644
index 00000000..ac94c713
--- /dev/null
+++ b/src/boost/libs/outcome/test/compile-fail/issue0071-fail.cpp
@@ -0,0 +1,37 @@
+/* clang-format off
+(error: no matching function for call to .+::basic_result|error: no matching constructor for initialization of 'result<udt>'|cannot convert argument 1 from 'int')
+clang-format on
+
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License in the accompanying file
+Licence.txt or at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+
+Distributed under the Boost Software License, Version 1.0.
+(See accompanying file Licence.txt or copy at
+http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+#include "../../include/boost/outcome/result.hpp"
+
+int main()
+{
+ using namespace BOOST_OUTCOME_V2_NAMESPACE;
+ struct udt
+ {
+ explicit udt(int /*unused*/) {}
+ };
+ // Must not be possible to implicitly initialise a result<udt>
+ result<udt> m(5);
+ return 0;
+}
diff --git a/src/boost/libs/outcome/test/compile-fail/outcome-int-int-1.cpp b/src/boost/libs/outcome/test/compile-fail/outcome-int-int-1.cpp
new file mode 100644
index 00000000..4ee66b74
--- /dev/null
+++ b/src/boost/libs/outcome/test/compile-fail/outcome-int-int-1.cpp
@@ -0,0 +1,33 @@
+/* clang-format off
+(use of deleted function|call to deleted constructor|attempting to reference a deleted function)
+clang-format on
+
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License in the accompanying file
+Licence.txt or at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+
+Distributed under the Boost Software License, Version 1.0.
+(See accompanying file Licence.txt or copy at
+http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+#include "../../include/boost/outcome/outcome.hpp"
+
+int main()
+{
+ using namespace BOOST_OUTCOME_V2_NAMESPACE;
+ // Must not be possible to initialise an outcome with same R, S and P types
+ outcome<int, int, int> m(5);
+ return 0;
+}
diff --git a/src/boost/libs/outcome/test/compile-fail/result-int-int-1.cpp b/src/boost/libs/outcome/test/compile-fail/result-int-int-1.cpp
new file mode 100644
index 00000000..e4eb9203
--- /dev/null
+++ b/src/boost/libs/outcome/test/compile-fail/result-int-int-1.cpp
@@ -0,0 +1,33 @@
+/* clang-format off
+(use of deleted function|call to deleted constructor|attempting to reference a deleted function)
+clang-format on
+
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License in the accompanying file
+Licence.txt or at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+
+Distributed under the Boost Software License, Version 1.0.
+(See accompanying file Licence.txt or copy at
+http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+#include "../../include/boost/outcome/result.hpp"
+
+int main()
+{
+ using namespace BOOST_OUTCOME_V2_NAMESPACE;
+ // Must not be possible to initialise a result with same R and S types
+ result<int, int> m(5);
+ return 0;
+}
diff --git a/src/boost/libs/outcome/test/compile-fail/result-int-int-2.cpp b/src/boost/libs/outcome/test/compile-fail/result-int-int-2.cpp
new file mode 100644
index 00000000..35c999d0
--- /dev/null
+++ b/src/boost/libs/outcome/test/compile-fail/result-int-int-2.cpp
@@ -0,0 +1,33 @@
+/* clang-format off
+(use of deleted function|call to deleted constructor|attempting to reference a deleted function)
+clang-format on
+
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License in the accompanying file
+Licence.txt or at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+
+Distributed under the Boost Software License, Version 1.0.
+(See accompanying file Licence.txt or copy at
+http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+#include "../../include/boost/outcome/result.hpp"
+
+int main()
+{
+ using namespace BOOST_OUTCOME_V2_NAMESPACE;
+ // Must not be possible to initialise a result with same R and S types
+ result<int, int> m(in_place_type<int>);
+ return 0;
+}