issue0071-fail.cpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /* clang-format off
  2. (error: no matching function for call to .+::basic_result|error: no matching constructor for initialization of 'result<udt>'|cannot convert argument 1 from 'int')
  3. clang-format on
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License in the accompanying file
  7. Licence.txt or at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. Distributed under the Boost Software License, Version 1.0.
  15. (See accompanying file Licence.txt or copy at
  16. http://www.boost.org/LICENSE_1_0.txt)
  17. */
  18. #include "../../include/boost/outcome/result.hpp"
  19. int main()
  20. {
  21. using namespace BOOST_OUTCOME_V2_NAMESPACE;
  22. struct udt
  23. {
  24. explicit udt(int /*unused*/) {}
  25. };
  26. // Must not be possible to implicitly initialise a result<udt>
  27. result<udt> m(5);
  28. return 0;
  29. }