forked from OSchip/llvm-project
10 lines
334 B
C++
10 lines
334 B
C++
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
|
|
|
|
struct S {
|
|
S *p = this; // ok
|
|
decltype(this) q; // expected-error {{invalid use of 'this' outside of a nonstatic member function}}
|
|
|
|
int arr[sizeof(this)]; // expected-error {{invalid use of 'this' outside of a nonstatic member function}}
|
|
int sz = sizeof(this); // ok
|
|
};
|