Home | History | Annotate | Download | only in SemaCXX

Lines Matching full:nullptr

4 typedef decltype(nullptr) nullptr_t;
16 null = nullptr;
17 void *p = nullptr;
19 int *pi = nullptr;
22 int A::*pm = nullptr;
24 void (*pf)() = nullptr;
26 void (A::*pmf)() = nullptr;
28 bool b = nullptr;
30 // Can't convert nullptr to integral implicitly.
31 uintptr_t i = nullptr; // expected-error {{cannot initialize}}
34 (void)(null == nullptr);
35 (void)(null <= nullptr);
38 (void)((void*)0 == nullptr);
41 (void)((void*)0 <= nullptr);
42 (void)(0 == nullptr);
43 (void)(nullptr == 0);
44 (void)(nullptr <= 0);
45 (void)(0 <= nullptr);
46 (void)(1 > nullptr); // expected-error {{invalid operands to binary expression}}
47 (void)(1 != nullptr); // expected-error {{invalid operands to binary expression}}
48 (void)(1 + nullptr); // expected-error {{invalid operands to binary expression}}
49 (void)(0 ? nullptr : 0);
50 (void)(0 ? nullptr : (void*)0);
51 (void)(0 ? nullptr : A()); // expected-error {{non-pointer operand type 'A' incompatible with nullptr}}
52 (void)(0 ? A() : nullptr); // expected-error {{non-pointer operand type 'A' incompatible with nullptr}}
55 int t = o1(nullptr);
57 o2(nullptr); // expected-error {{ambiguous}}
59 // nullptr is an rvalue, null is an lvalue
60 (void)&nullptr; // expected-error {{cannot take the address of an rvalue of type 'nullptr_t'}}
63 // You can reinterpret_cast nullptr to an integer.
64 (void)reinterpret_cast<uintptr_t>(nullptr);
67 // You can't reinterpret_cast nullptr to any integer
68 (void)reinterpret_cast<char>(nullptr); // expected-error {{cast from pointer to smaller type 'char' loses information}}
73 // You can throw nullptr.
74 throw nullptr;
77 // Template arguments can be nullptr.
81 typedef T<nullptr, nullptr, nullptr, nullptr> NT;
96 static_assert(is_same<decltype(g(nullptr)), void*>::value, "");
103 // nullptr can be used as the sentinel value.
104 f(10, nullptr);
112 // Don't warn when using nullptr with %p.
113 f("%p", nullptr);
121 static_assert(!(nullptr < nullptr), "");
122 static_assert(!(nullptr > nullptr), "");
123 static_assert( nullptr <= nullptr, "");
124 static_assert( nullptr >= nullptr, "");
125 static_assert( nullptr == nullptr, "");
126 static_assert(!(nullptr != nullptr), "");
128 static_assert(!(0 < nullptr), "");
129 static_assert(!(0 > nullptr), "");
130 static_assert( 0 <= nullptr, "");
131 static_assert( 0 >= nullptr, "");
132 static_assert( 0 == nullptr, "");
133 static_assert(!(0 != nullptr), "");
135 static_assert(!(nullptr < 0), "");
136 static_assert(!(nullptr > 0), "");
137 static_assert( nullptr <= 0, "");
138 static_assert( nullptr >= 0, "");
139 static_assert( nullptr == 0, "");
140 static_assert(!(nullptr != 0), "");
147 int &ir = (f1)(nullptr);
172 X<int, nullptr> x;
178 X2<nullptr, nullptr, nullptr, nullptr> x2;