File: deuglify.cpp

package info (click to toggle)
llvm-toolchain-15 1%3A15.0.6-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,554,644 kB
  • sloc: cpp: 5,922,452; ansic: 1,012,136; asm: 674,362; python: 191,568; objc: 73,855; f90: 42,327; lisp: 31,913; pascal: 11,973; javascript: 10,144; sh: 9,421; perl: 7,447; ml: 5,527; awk: 3,523; makefile: 2,520; xml: 885; cs: 573; fortran: 567
file content (25 lines) | stat: -rw-r--r-- 1,028 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Fake standard library with uglified names.
// Parameters (including template params) get ugliness stripped.
namespace std {

template <typename _Tp>
class __vector_base {};

template <typename _Tp>
class vector : private __vector_base<_Tp> {
public:
  _Tp &at(unsigned __index) const;
  int __stays_ugly();
};

} // namespace std

int x = std::vector<int>{}.at(42);
// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:17:14 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
// CHECK-CC1: COMPLETION: __vector_base : __vector_base<<#typename Tp#>>
// CHECK-CC1: COMPLETION: vector : vector<<#typename Tp#>>
// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:17:28 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s
// CHECK-CC2: COMPLETION: __stays_ugly : [#int#]__stays_ugly()
// CHECK-CC2: COMPLETION: at : [#int &#]at(<#unsigned int index#>)[# const#]
// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:17:31 %s -o - | FileCheck -check-prefix=CHECK-CC3 %s
// CHECK-CC3: OVERLOAD: [#int &#]at(<#unsigned int index#>)