43 lines · cpp
1// RUN: %clang_cc1 -x c++-header -emit-pch %s -o %t2// RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s3 4// expected-no-diagnostics5 6#ifndef HEADER_INCLUDED7#define HEADER_INCLUDED8 9static inline void foo(int &x, int y) {10 // Capturing x and y11 #pragma clang __debug captured12 {13 x += y;14 }15}16 17struct C {18 int val;19 20 explicit C(int v) : val(v) { }21 22 void bar(int &x) {23 // Capturing x and this24 #pragma clang __debug captured25 {26 x += val;27 }28 }29};30 31#else32 33void test_foo(int &x) {34 foo(x, 10);35}36 37void test_bar(int &x) {38 C Obj(10);39 Obj.bar(x);40}41 42#endif43