aboutsummaryrefslogtreecommitdiff
path: root/test/CXX/expr/expr.prim/expr.prim.general/p4-0x.cpp
blob: b976e1664e1fe59ee95c7c194d4c2f1953b37722 (plain)
1
2
3
4
5
6
7
8
9
// 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
};