summaryrefslogtreecommitdiffstats
path: root/debian/uncrustify-trinity/uncrustify-trinity-0.78.0/tests/input/cpp/attribute_specifier_seqs.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2023-11-18 17:53:35 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2023-11-19 19:27:29 +0900
commitc0a6f1b84c84749908961579b84513fd9f9d9eac (patch)
treeace7ba60cb031acd3a1f4ff10f7bbc5668fa801f /debian/uncrustify-trinity/uncrustify-trinity-0.78.0/tests/input/cpp/attribute_specifier_seqs.cpp
parent52e5ffe140f0f4402e97936447bc9a606045d2b5 (diff)
downloadextra-dependencies-c0a6f1b84c84749908961579b84513fd9f9d9eac.tar.gz
extra-dependencies-c0a6f1b84c84749908961579b84513fd9f9d9eac.zip
uncrustify-trinity: updated based on upstream version 0.78.0
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'debian/uncrustify-trinity/uncrustify-trinity-0.78.0/tests/input/cpp/attribute_specifier_seqs.cpp')
-rw-r--r--debian/uncrustify-trinity/uncrustify-trinity-0.78.0/tests/input/cpp/attribute_specifier_seqs.cpp112
1 files changed, 112 insertions, 0 deletions
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.78.0/tests/input/cpp/attribute_specifier_seqs.cpp b/debian/uncrustify-trinity/uncrustify-trinity-0.78.0/tests/input/cpp/attribute_specifier_seqs.cpp
new file mode 100644
index 00000000..744b3404
--- /dev/null
+++ b/debian/uncrustify-trinity/uncrustify-trinity-0.78.0/tests/input/cpp/attribute_specifier_seqs.cpp
@@ -0,0 +1,112 @@
+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;
+};
+
+class [[foo, bar("baz")]] /**/ Y :private Foo, Bar {
+public:
+int v(int &x) { return x; }
+};
+
+class
+[[foo]]
+[[bar("baz")]]
+Z:Foo, public Bar {
+public:
+int v(int * x) { return *x; }
+};
+
+int g(int* p) [[ensures: p != nullptr]]
+{
+*p = 42;
+}
+
+bool meow(const int&) { return true; }
+void i(int& x) [[ensures: meow(x)]]
+{
+++x;
+}
+
+enum Enum {
+a, b };
+enum class [[foo]] Enum {
+a, b };
+enum struct [[foo]] /**/ [[bar("baz")]] Enum {
+a, b };
+enum [[foo]]
+Enum {
+a, b };
+enum class [[foo]] //
+[[bar("baz")]] Enum {
+a, b };
+enum struct //
+[[bar("baz")]] Enum {
+a, b };
+enum
+[[foo]] [[bar("baz")]] /**/ Enum {
+a, b };
+enum class /**/ [[foo]] [[bar("baz")]]
+Enum {
+a, b };
+enum //
+struct
+[[foo]]
+[[bar("baz")]]
+Enum {
+a, b };