optional_rvalue_ref.fail.cpp 632 B

1234567891011121314151617181920212223
  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
  10. // <optional>
  11. // A program that necessitates the instantiation of template optional for a
  12. // reference type is ill-formed.
  13. #include <experimental/optional>
  14. int main()
  15. {
  16. using std::experimental::optional;
  17. optional<int&&> opt;
  18. }