File: attribute_specifier_seqs.cpp

package info (click to toggle)
uncrustify 0.68.1%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 18,000 kB
  • sloc: cpp: 56,567; ansic: 19,840; cs: 3,097; python: 2,717; objc: 1,650; java: 510; sh: 390; awk: 150; perl: 63; makefile: 7
file content (71 lines) | stat: -rw-r--r-- 1,386 bytes parent folder | download
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
void asd(void)
{
   a < up_lim() ? do_hi() : do_low;
   a[ a<b>c] = d;
}

[[nodiscard]] inline static CFErrorRef _Nullable CreateErrorIfError(CFStringRef const inDomain, CFIndex const inCode, CFDictionaryRef const inInformation) {
[[maybe_unused]] auto const [iterator, inserted]{ super_type::insert(ioFileReference) };
if (inCode == 0) {
return nullptr;
}
return ::CFErrorCreate(kCFAllocatorDefault, inDomain, inCode, inInformation);
}

[[gnu::always_inline]] [[gnu::hot]] [[gnu::const]] [[nodiscard]]
inline int f();
[[gnu::always_inline, gnu::const, gnu::hot, nodiscard]]
int f();
[[using gnu : const, always_inline, hot]] [[nodiscard]]
int f[[gnu::always_inline]]();

int f(int i) [[expects: i > 0]] [[ensures audit x: x < 1]];

void f() {
int i [[cats::meow([[]])]];
int x [[unused]] = f();
}

int f(int i) [[deprecated]] {
switch(i) {
case 1: [[fallthrough]];
[[likely]] case 2: return 1;
}
return 2;
}

[[
unused, deprecated("keeping for reference only")
]]
void f()
{
}

[[noreturn]] void f() [[deprecated("because")]] {
throw "error";
}

void print2(int * [[carries_dependency]] val)
{
std::cout<<*p<<std::endl;
}

class X {
public:
int v() const { return x; }
int g() [[expects: v() > 0]];
private:
int k() [[expects: x > 0]];
int x;
};

int g(int* p) [[ensures: p != nullptr]]
{
*p = 42;
}

bool meow(const int&) { return true; }
void i(int& x) [[ensures: meow(x)]]
{
++x;
}