Lines Matching defs:optional
171 std::optional<int> o;
176 std::optional<int> o;
201 std::optional<std::string> o;
204 std::optional<std::string_view> abc;
223 int &&r = *std::optional<int>(); // expected-warning {{object backing the pointer will be destroyed at the end of the full-expression}}
224 int &&r2 = *std::optional<int>(5); // expected-warning {{object backing the pointer will be destroyed at the end of the full-expression}}
225 int &&r3 = std::optional<int>(5).value(); // expected-warning {{object backing the pointer will be destroyed at the end of the full-expression}}
230 std::optional<std::vector<int>> getTempOptVec();
439 std::string_view test2(int i, std::optional<std::string_view> a) {
449 FooView test3(int i, std::optional<Foo> a) {
518 std::optional<std::string_view> o1 = std::string(); // expected-warning {{object backing the pointer}}
522 // 1. make_optional creates a temporary "optional<string>"" object
525 std::optional<std::string_view> o2 = std::make_optional(s); // expected-warning {{object backing the pointer}}
526 std::optional<std::string_view> o3 = std::optional<std::string>(s); // expected-warning {{object backing the pointer}}
527 std::optional<std::string_view> o4 = std::optional<std::string_view>(s);
535 std::optional<std::string_view> n2 = {std::string_view()};
536 std::optional<std::string_view> n3 = std::string_view();
537 std::optional<std::string_view> n4 = std::make_optional(std::string_view());
539 std::optional<std::string_view> n5 = std::make_optional(b);
540 std::optional<std::string_view> n6 = std::make_optional("test");
558 std::optional<Foo> GetFoo();
559 std::optional<FooOwner> GetFooOwner();
571 std::optional<std::string_view> test3(int i) {
583 std::optional<int*> test4(int a) {
668 std::optional<Span<int*>> abc = std::vector<int*>{};
670 std::optional<Span<int>> t = std::vector<int> {}; // expected-warning {{object backing the pointer will be destroyed}}