blob: 6f5ca3836e05191b764660ca117850ecaab248e3 [file] [log] [blame]
Ben Langmuirce914fc2013-05-03 19:20:19 +00001// RUN: %clang_cc1 -x c++-header -emit-pch %s -o %t
2// RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s
3
4// expected-no-diagnostics
5
6#ifndef HEADER_INCLUDED
7#define HEADER_INCLUDED
8
9static inline void foo(int &x, int y) {
10 // Capturing x and y
11 #pragma clang __debug captured
12 {
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 this
24 #pragma clang __debug captured
25 {
26 x += val;
27 }
28 }
29};
30
31#else
32
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#endif