1 // Test for debug info for C++11 deleted member functions
2
3 //Supported: -O0, standalone DI
4 // RUN: %clang_cc1 -emit-llvm -triple x86_64-linux-gnu %s -o - \
5 // RUN: -O0 -disable-llvm-passes \
6 // RUN: -debug-info-kind=standalone \
7 // RUN: | FileCheck %s -check-prefix=ATTR
8
9 // ATTR: DISubprogram(name: "deleted", {{.*}}, flags: DIFlagPublic | DIFlagPrototyped,
10 // ATTR: DISubprogram(name: "deleted", {{.*}}, flags: DIFlagPublic | DIFlagPrototyped, spFlags: DISPFlagDeleted
11 // ATTR: DISubprogram(name: "operator=", linkageName: "_ZN7deletedaSERKS_", {{.*}}, flags: DIFlagPublic | DIFlagPrototyped, spFlags: DISPFlagDeleted
12 // ATTR: DISubprogram(name: "deleted", {{.*}}, flags: DIFlagPublic | DIFlagPrototyped, spFlags: DISPFlagDeleted
13 // ATTR: DISubprogram(name: "operator=", linkageName: "_ZN7deletedaSEOS_", {{.*}}, flags: DIFlagPublic | DIFlagPrototyped, spFlags: DISPFlagDeleted
14 // ATTR: DISubprogram(name: "~deleted", {{.*}}, flags: DIFlagPublic | DIFlagPrototyped,
15 class deleted {
16 public:
17 // Defaulted on purpose, so as to facilitate object creation
18 deleted() = default;
19
20 deleted(const deleted &) = delete;
21 deleted &operator=(const deleted &) = delete;
22
23 deleted(deleted &&) = delete;
24 deleted &operator=(deleted &&) = delete;
25
26 ~deleted() = default;
27 };
28
foo()29 void foo() {
30 deleted obj1;
31 }
32