/llvm-project/clang/test/Lexer/ |
H A D | size_t-literal.cpp | 19 auto a1 = 1z; in ValidSuffix() 20 auto a2 = 1Z; in ValidSuffix() 22 auto a3 = 1uz; in ValidSuffix() 23 auto a4 = 1uZ; in ValidSuffix() 24 auto a5 = 1Uz; in ValidSuffix() 25 auto a6 = 1UZ; in ValidSuffix() 27 auto a7 = 1zu; in ValidSuffix() 28 auto a8 = 1Zu; in ValidSuffix() 29 auto a9 = 1zU; in ValidSuffix() 30 auto a10 = 1ZU; in ValidSuffix() [all …]
|
/llvm-project/clang-tools-extra/test/clang-tidy/checkers/readability/ |
H A D | qualified-auto.cpp | 1 // RUN: %check_clang_tidy %s readability-qualified-auto %t 15 auto TdNakedPtr = getPtr(); in foo() 16 …// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: 'auto TdNakedPtr' can be declared as 'auto *TdNakedPtr' in foo() 17 // CHECK-FIXES: {{^}} auto *TdNakedPtr = getPtr(); in foo() 18 auto &TdNakedRef = getRef(); in foo() 19 auto TdNakedRefDeref = getRef(); in foo() 20 auto TdNakedCPtr = getCPtr(); in foo() 21 …// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: 'auto TdNakedCPtr' can be declared as 'const auto *TdN… in foo() 22 // CHECK-FIXES: {{^}} const auto *TdNakedCPtr = getCPtr(); in foo() 23 auto &TdNakedCRef = getCRef(); in foo() [all …]
|
/llvm-project/clang/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/ |
H A D | p5.cpp | 6 auto a; // expected-error{{'auto' not allowed in non-static struct member}} 7 auto *b; // expected-error{{'auto' not allowed in non-static struct member}} 8 const auto c; // expected-error{{'auto' not allowed in non-static struct member}} 10 void f() throw (auto); // expected-error{{'auto' not allowed here}} 12 friend auto; // expected-error{{'auto' not allowed in friend declaration}} 14 operator auto(); // expected-error{{'auto' not allowed in conversion function type}} 17 // PR 9278: auto is not allowed in typedefs, except with a trailing return type. 18 typedef auto *AutoPtr; // expected-error{{'auto' not allowed in typedef}} 19 typedef auto (*PFun)(int a); // expected-error{{'auto' not allowed in typedef}} 20 typedef auto Fun(int a) -> decltype(a + a); [all …]
|
H A D | p7-cxx14.cpp | 23 auto x3a = i; 24 decltype(auto) x3d = i; 28 auto x4a = (i); 29 decltype(auto) x4d = (i); 33 auto x5a = f(); 34 decltype(auto) x5d = f(); 38 auto x6a = { 1, 2 }; 39 decltype(auto) x6d = { 1, 2 }; // expected-error {{cannot deduce 'decltype(auto)' from initializer … 42 auto *x7a = &i; 43 decltype(auto) *x7d = &i; // expected-error {{cannot form pointer to 'decltype(auto)'}} [all …]
|
H A D | p3-generic-lambda-1y.cpp | 7 auto GL1 = [](auto a, int i) -> int { return id(a); }; in __anon11e6371c0102() 9 auto GL2 = [](auto ... As) -> int { return vfoo(As...); }; in __anon11e6371c0202() 10 auto GL3 = [](int i, char c, auto* ... As) -> int { return vfoo(As...); }; in __anon11e6371c0302() 12 auto GL4 = [](int i, char c, auto* ... As) -> int { return vfoo(As...); }; in __anon11e6371c0402() 16 auto GL1 = [](auto a, int i) -> int { return id(a); }; in foo() 18 auto GL2 = [](auto ... As) -> int { return vfoo(As...); }; in foo() 23 auto l1 = [](auto a) -> int { return a + 5; }; in main() 24 auto l2 = [](auto *p) -> int { return p + 5; }; in main() 27 auto l3 = [](auto &&ur, in main() 28 auto &lr, in main() [all …]
|
H A D | p3.cpp | 4 …auto a = a; // expected-error{{variable 'a' declared with deduced type 'auto' cannot appear in its… in f() 5 …auto *b = b; // expected-error{{variable 'b' declared with deduced type 'auto *' cannot appear in … in f() 6 …const auto c = c; // expected-error{{variable 'c' declared with deduced type 'const auto' cannot a… in f() 7 …if (auto d = d) {} // expected-error {{variable 'd' declared with deduced type 'auto' cannot appea… in f() 8 …auto e = ({ auto f = e; 0; }); // expected-error {{variable 'e' declared with deduced type 'auto' … in f() 12 …auto a; // expected-error{{declaration of variable 'a' with deduced type 'auto' requires an initia… in g() 14 …auto *b; // expected-error{{declaration of variable 'b' with deduced type 'auto *' requires an ini… in g() 16 if (auto b) {} // expected-error {{must have an initializer}} in g() 17 for (;auto b;) {} // expected-error {{must have an initializer}} in g() 18 while (auto b) {} // expected-error {{must have an initializer}} in g() [all …]
|
/llvm-project/clang/test/SemaCXX/ |
H A D | deduced-return-void.cpp | 13 auto f1() { } in f1() 14 auto f2() { return; } in f2() 15 auto f3() { return void(); } in f3() 16 auto f4() { in f4() 18 …return; // expected-error {{'auto' in return type deduced as 'void' here but deduced as 'int' in e… in f4() 20 auto f5() { in f5() 22 …return void(); // expected-error {{'auto' in return type deduced as 'void' here but deduced as 'in… in f5() 25 auto l1 = []() { }; in __anon22edc4580102() 26 auto l2 = []() { return; }; in __anon22edc4580202() 27 auto l3 = []() { return void(); }; in __anon22edc4580302() [all …]
|
H A D | warn-unused-lambda-capture.cpp | 33 auto captures_nothing = [] {}; in test() 35 auto captures_nothing_by_value = [=] {}; in test() 36 auto captures_nothing_by_reference = [&] {}; in test() 38 auto implicit_by_value = [=]() mutable { i++; }; in test() 39 auto implicit_by_reference = [&] { i++; }; in test() 41 auto explicit_by_value_used = [i] { return i + 1; }; in test() 42 auto explicit_by_value_used_void = [i] { (void)i; }; in test() 43 auto explicit_by_value_unused = [i] {}; // expected-warning{{lambda capture 'i' is not used}} in test() 44 …auto explicit_by_value_unused_sizeof = [i] { return sizeof(i); }; // expected-warning{{lambda capt… in test() 45 …auto explicit_by_value_unused_decltype = [i] { decltype(i) j = 0; }; // expected-warning{{lambda c… in test() [all …]
|
H A D | cxx1y-generic-lambdas-capturing.cpp | 38 auto L = [](auto a) { return a; }; in foo() 41 auto L = [](auto a) -> void { in foo2() 42 auto M = [](char b) -> void { in foo2() 43 auto N = [](auto c) -> void { in foo2() 66 auto L = [](auto a, auto b) { in doit() 72 auto L2 = [](auto a, int i) { in doit() 79 auto B = []() { return ^{ return a; }; }; //expected-error{{cannot be implicitly capture}}\ in doit() 85 //auto X = ^{ return a; }; in doit() 87 //auto Y = []() -> auto { return 3; return 'c'; }; in doit() 98 auto L = [=](auto a) { in doit() [all …]
|
H A D | deduced-return-type-cxx14.cpp | 10 auto f(); // expected-note {{previous}} 13 auto &g(); 14 auto g() -> auto &; 16 auto h() -> auto *; 17 auto *h(); 20 operator auto(); // expected-note {{declared here}} 22 int conv1a = conv1; // expected-error {{function 'operator auto' with deduced return type cannot be… 24 Conv1::operator auto() { return 123; } in operator auto() 26 int conv1c = conv1.operator auto(); 30 operator auto() { return 0; } // expected-note {{previous}} in operator auto() [all …]
|
H A D | cxx1y-generic-lambdas.cpp | 16 auto L = [i](auto a) { return i + a; }; in test() 23 auto L = [](auto a) { return a; }; in test() 34 T (*fp)(T) = [](auto a) { return a; }; in __anon11d644c60302() 41 void fooT(T t, T (*fp)(T) = [](auto a) { return a; }) { in __anon11d644c60402() 47 auto L = [](auto a) { return a; }; in test() 60 auto L = [](auto in test() 952 __anon11d644c67502(auto ...) __anon11d644c67502() argument 956 __anon11d644c67602(auto) __anon11d644c67602() argument 1035 __anon11d644c68302(auto (*p)() -> auto) __anon11d644c68302() argument [all...] |
/llvm-project/clang/test/C/C23/ |
H A D | n3007.c | 7 auto int auto_int = 12; in test_auto_int() 11 const auto a = x; in test_qualifiers() 12 auto b = y; in test_qualifiers() 13 static auto c = 1UL; in test_qualifiers() 19 auto yup = ci; in test_qualifiers() 22 auto r_test = z; in test_qualifiers() 32 _Atomic auto i = 12; // expected-error {{_Atomic cannot be applied to type 'auto' in C23}} in test_atomic() 33 _Atomic(auto) j = 12; // expected-error {{'auto' not allowed here}} \ in test_atomic() 37 auto k = foo(); in test_atomic() 39 …_Static_assert(_Generic(&i, _Atomic auto *: 1)); // expected-error {{_Atomic cannot be applied to … in test_atomic() [all …]
|
/llvm-project/clang/test/Analysis/ |
H A D | iterator-range.cpp | 11 auto i = V.begin(); in deref_begin() 16 auto i = ++V.begin(); in deref_begind_begin() 23 auto i = return_any_iterator(V.begin()); in deref_unknown() 28 auto i = --V.end(); in deref_ahead_of_end() 33 auto i = V.end(); in deref_end() 41 auto i = V.begin(); in incr_begin() 46 auto i = ++V.begin(); in incr_behind_begin() 51 auto i = return_any_iterator(V.begin()); in incr_unknown() 56 auto i = --V.end(); in incr_ahead_of_end() 61 auto i = V.end(); in incr_end() [all …]
|
/llvm-project/clang/test/Parser/ |
H A D | cxx2a-placeholder-type-constraint.cpp | 13 {ns::D auto a = 1;} in foo() 14 {C auto a = 1;} in foo() 15 {C<> auto a = 1;} in foo() 16 {C<int> auto a = 1;} in foo() 17 {ns::D<int> auto a = 1;} in foo() 18 {const ns::D auto &a = 1;} in foo() 19 {const C auto &a = 1;} in foo() 20 {const C<> auto &a = 1;} in foo() 21 {const C<int> auto &a = 1;} in foo() 22 {const ns::D<int> auto &a = 1;} in foo() [all …]
|
H A D | c2x-auto.c | 5 auto _NAME = ARG + (ARG2 / ARG3); 9 auto b; // c23-error {{'auto' not allowed in struct member}} \ 14 auto smth; // c23-error {{'auto' not allowed in union member}} \ 20 enum E : auto { // c23-error {{'auto' not allowed here}} \ 28 auto basic_usage(auto auto) { // c23-error {{'auto' not allowed in function prototype}} \ in basic_usage() argument 29 c23-error {{'auto' not allowed in function return type}} \ in basic_usage() 30 … c23-error {{cannot combine with previous 'auto' declaration specifier}} \ in basic_usage() 33 c17-warning {{duplicate 'auto' declaration specifier}} \ in basic_usage() 38 auto = 4; // expected-error {{expected identifier or '('}} in basic_usage() 40 …auto a = 4; // c17-error {{type specifier missing, defaults to 'int'; ISO C99 an… in basic_usage() [all …]
|
H A D | cxx2a-abbreviated-templates.cpp | 12 void foo1(C auto a, 13 C<int> auto b, 14 ns::D auto c, 15 ns::D<int> auto d, 16 const C auto e, 17 const C<int> auto f, 18 const ns::D auto g, 19 const ns::D<int> auto h); 20 void foo2(C auto a); 21 void foo3(C<int> auto b); [all …]
|
/llvm-project/flang/unittests/Optimizer/Builder/ |
H A D | FIRBuilderTest.cpp | 25 auto loc = builder.getUnknownLoc(); in SetUp() 33 auto *entryBlock = func.addEntryBlock(); in SetUp() 47 auto loc = builder.getUnknownLoc(); in createCondition() 48 auto zero1 = builder.createIntegerConstant(loc, builder.getIndexType(), 0); in createCondition() 49 auto zero2 = builder.createIntegerConstant(loc, builder.getIndexType(), 0); in createCondition() 56 auto cstOp = dyn_cast<mlir::arith::ConstantOp>(value.getDefiningOp()); in checkIntegerConstant() 58 auto valueAttr = mlir::dyn_cast_or_null<IntegerAttr>(cstOp.getValue()); in checkIntegerConstant() 67 auto builder = getBuilder(); in TEST_F() 68 auto loc = builder.getUnknownLoc(); in TEST_F() 69 auto cd in TEST_F() [all...] |
/llvm-project/clang-tools-extra/test/clang-tidy/checkers/modernize/ |
H A D | use-auto-iterator.cpp | 1 // RUN: %check_clang_tidy -std=c++11,c++14 %s modernize-use-auto %t -- -- -I %S/Inputs/use-auto 9 // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use auto when declaring iterators [modernize-use-auto] in f_array() 10 // CHECK-FIXES: auto ArrayI1 = C.begin(); in f_array() 13 // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use auto when declaring iterators in f_array() 14 // CHECK-FIXES: auto ArrayI2 = C.rbegin(); in f_array() 18 // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use auto when declaring iterators in f_array() 19 // CHECK-FIXES: auto ArrayI3 = D.begin(); in f_array() 22 // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use auto when declaring iterators in f_array() 23 // CHECK-FIXES: auto ArrayI4 = D.rbegin(); in f_array() 29 // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use auto when declaring iterators in f_deque() [all …]
|
H A D | use-auto-cast-remove-stars.cpp | 1 // RUN: %check_clang_tidy %s modernize-use-auto %t -- \ 2 // RUN: -config="{CheckOptions: {modernize-use-auto.RemoveStars: 'true' , modernize-use-auto.MinT… 16 …// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use auto when initializing with a cast to avoid duplic… in f_static_cast() 17 // CHECK-FIXES: auto i1 = static_cast<int>(l); in f_static_cast() 20 …// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: use auto when initializing with a cast to avoid duplic… in f_static_cast() 21 // CHECK-FIXES: const auto i2 = static_cast<int>(l); in f_static_cast() 24 …// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use auto when initializing with a cast to avoid duplic… in f_static_cast() 25 // CHECK-FIXES: auto ll = static_cast<long long>(l); in f_static_cast() 27 …// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use auto when initializing with a cast to avoid duplic… in f_static_cast() 28 // CHECK-FIXES: auto ull = static_cast<unsigned long long>(l); in f_static_cast() [all …]
|
H A D | use-auto-cast.cpp | 1 // RUN: %check_clang_tidy %s modernize-use-auto %t -- \ 2 // RUN: -config="{CheckOptions: {modernize-use-auto.MinTypeNameLength: '0'}}" \ 3 // RUN: -- -I %S/Inputs/use-auto -frtti 16 …// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use auto when initializing with a cast to avoid duplic… in f_static_cast() 17 // CHECK-FIXES: auto i1 = static_cast<int>(l); in f_static_cast() 20 …// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: use auto when initializing with a cast to avoid duplic… in f_static_cast() 21 // CHECK-FIXES: const auto i2 = static_cast<int>(l); in f_static_cast() 24 …// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use auto when initializing with a cast to avoid duplic… in f_static_cast() 25 // CHECK-FIXES: auto ll = static_cast<long long>(l); in f_static_cast() 27 …// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use auto when initializing with a cast to avoid duplic… in f_static_cast() [all …]
|
/llvm-project/mlir/unittests/Dialect/Utils/ |
H A D | StructuredOpsUtilsTest.cpp | 26 auto mapA = AffineMapAttr::get(AffineMap::get(3, 0, {m, k}, &context)); in TEST() 27 auto mapB = AffineMapAttr::get(AffineMap::get(3, 0, {k, n}, &context)); in TEST() 28 auto mapC = AffineMapAttr::get(AffineMap::get(3, 0, {m, n}, &context)); in TEST() 29 auto maps = ArrayAttr::get(&context, {mapA, mapB, mapC}); in TEST() 39 auto mapA = AffineMapAttr::get(AffineMap::get(3, 0, {m, k}, &context)); in TEST() 40 auto mapB = AffineMapAttr::get(AffineMap::get(3, 0, {k, n}, &context)); in TEST() 41 auto mapC = AffineMapAttr::get(AffineMap::get(3, 0, {m, n}, &context)); in TEST() 42 auto maps = ArrayAttr::get(&context, {mapA, mapB, mapC}); in TEST() 52 auto mapA = AffineMapAttr::get(AffineMap::get(3, 0, {m, k}, &context)); in TEST() 53 auto mapB = AffineMapAttr::get(AffineMap::get(3, 0, {k, n}, &context)); in TEST() [all …]
|
/llvm-project/clang/test/Sema/ |
H A D | c2x-auto.c | 5 …auto undefined; // expected-error {{declaration of variable 'undefined' with deduced type 'aut… in test_basic_types() 6 auto auto_int = 4; in test_basic_types() 7 auto auto_long = 4UL; in test_basic_types() 8 auto int auto_int_ts = 12; in test_basic_types() 9 signed auto a = 1L; // expected-error {{'auto' cannot be signed or unsigned}} in test_basic_types() 16 _Complex auto i = 12.0; // expected-error {{'_Complex auto' is invalid}} in test_complex_types() 20 auto t = ({ // expected-warning {{use of GNU statement expression extension}} in test_gnu_extensions() 21 auto b = 12; in test_gnu_extensions() 28 auto auto_size = sizeof(auto); // expected-error {{expected expression}} in test_sizeof_typeof() 29 typeof(auto) tpof = 4; // expected-error {{expected expression}} in test_sizeof_typeof() [all …]
|
/llvm-project/clang/test/CXX/expr/expr.post/expr.type.conv/ |
H A D | p1-2b.cpp | 12 // C++23 [dcl.type.auto.deduct]p2.3 13 // For an explicit type conversion, T is the specified type, which shall be auto. 15 foo(auto()); // expected-error {{initializer for functional-style cast to 'auto' is empty}} in diagnostics() 16 foo(auto{}); // expected-error {{initializer for functional-style cast to 'auto' is empty}} in diagnostics() 17 …foo(auto({})); // expected-error {{cannot deduce actual type for 'auto' from parenthesized initial… in diagnostics() 18 …foo(auto{{}}); // expected-error {{cannot deduce actual type for 'auto' from nested initializer li… in diagnostics() 21 foo(auto(a)); in diagnostics() 23 foo(auto{a}); in diagnostics() 24 …foo(auto({a})); // expected-error {{cannot deduce actual type for 'auto' from parenthesized initia… in diagnostics() 25 …foo(auto{{a}}); // expected-error {{cannot deduce actual type for 'auto' from nested initializer l… in diagnostics() [all …]
|
/llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.modifiers/ |
H A D | insert_range_after.pass.cpp | 50 …auto get_insert_pos = [](auto& c, auto& test_case) { return std::ranges::next(c.before_begin(), te… in test_sequence_insert_range_after() 52 auto get_return_pos = [](auto& c, auto& test_case) { in test_sequence_insert_range_after() 58 auto& test_case = EmptyContainer_EmptyRange<T>; in test_sequence_insert_range_after() 61 auto in = wrap_input<Iter, Sent>(test_case.input); in test_sequence_insert_range_after() 62 auto pos = get_insert_pos(c, test_case); in test_sequence_insert_range_after() 64 auto result = c.insert_range_after(pos, in); in test_sequence_insert_range_after() 70 auto& test_case = EmptyContainer_OneElementRange<T>; in test_sequence_insert_range_after() 73 auto in = wrap_input<Iter, Sent>(test_case.input); in test_sequence_insert_range_after() 74 auto pos = get_insert_pos(c, test_case); in test_sequence_insert_range_after() 76 auto result = c.insert_range_after(pos, in); in test_sequence_insert_range_after() [all …]
|
/llvm-project/lldb/test/API/lang/cpp/const_static_integral_member/ |
H A D | main.cpp | 35 const static auto char_max = std::numeric_limits<char>::max(); 36 const static auto schar_max = std::numeric_limits<signed char>::max(); 37 const static auto uchar_max = std::numeric_limits<unsigned char>::max(); 38 const static auto int_max = std::numeric_limits<int>::max(); 39 const static auto uint_max = std::numeric_limits<unsigned>::max(); 40 const static auto long_max = std::numeric_limits<long>::max(); 41 const static auto ulong_max = std::numeric_limits<unsigned long>::max(); 42 const static auto longlong_max = std::numeric_limits<long long>::max(); 43 const static auto ulonglong_max = 45 const static auto wchar_ma [all...] |