Lines Matching full:volatile
285 // - a non-volatile glvalue of integral or enumeration type that refers to a
286 // non-volatile const object with a preceding initialization, initialized
289 volatile const int vi = 1; // expected-note 2{{here}}
291 volatile const int &vrci = ci;
292 volatile-qualified type}}
293 static_assert(const_cast<int&>(vi), ""); // expected-error {{constant expression}} expected-note {{read of volatile object 'vi'}}
294 static_assert(vrci, ""); // expected-error {{constant expression}} expected-note {{read of volatile-qualified type}}
296 // - a non-volatile glvalue of literal type that refers to a non-volatile
301 volatile int v; // expected-note {{not literal because}}
305 constexpr S(int=0) : i(1), v(const_cast<volatile int&>(vi)) {}
306 constexpr S(const S &s) : i(2), v(const_cast<volatile int&>(vi)) {}
308 volatile int &v;
311 constexpr volatile S vs; // expected-note {{here}}
312 constexpr const volatile S &vrs = s; // ok
314 static_assert(s.v, ""); // expected-error {{constant expression}} expected-note {{read of volatile-qualified type}}
315 static_assert(const_cast<int&>(s.v), ""); // expected-error {{constant expression}} expected-note {{read of volatile object 'vi'}}
316 static_assert(vs.i, ""); // expected-error {{constant expression}} expected-note {{read of volatile-qualified type}}
317 static_assert(const_cast<int&>(vs.i), ""); // expected-error {{constant expression}} expected-note {{read of volatile object 'vs'}}
318 static_assert(vrs.i, ""); // expected-error {{constant expression}} expected-note {{read of volatile-qualified type}}
320 // - a non-volatile glvalue of literal type that refers to a non-volatile
323 constexpr volatile S f() { return S(); }
325 static_assert(((volatile const S&&)(S)0).i, ""); // expected-error {{constant expression}}