blob: 13735fab4a9deb0b305fd0043ab9149e68f1f3a6 [file] [log] [blame]
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++0x %s
struct S {
S *p = this; // ok
decltype(this) q; // expected-error {{invalid use of 'this' outside of a nonstatic member function}} \
expected-error {{C++ requires a type specifier for all declarations}}
int arr[sizeof(this)]; // expected-error {{invalid use of 'this' outside of a nonstatic member function}}
int sz = sizeof(this); // ok
};