not_brace_initializable.fail.cpp 690 B

12345678910111213141516171819202122232425
  1. //===----------------------------------------------------------------------===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is dual licensed under the MIT and the University of Illinois Open
  6. // Source Licenses. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. // UNSUPPORTED: c++98, c++03, c++11, c++14
  10. // <optional>
  11. // struct nullopt_t{see below};
  12. #include <optional>
  13. using std::optional;
  14. using std::nullopt_t;
  15. int main()
  16. {
  17. // I roughly interpret LWG2736 as "it shall not be possible to copy-list-initialize nullopt_t with an
  18. // empty braced-init-list."
  19. nullopt_t foo = {};
  20. }