Home
last modified time | relevance | path

Searched full:casting (Results 1 – 25 of 1083) sorted by relevance

12345678910>>...44

/llvm-project/clang-tools-extra/test/clang-tidy/checkers/readability/
H A Dredundant-casting.cpp1 // RUN: %check_clang_tidy -std=c++11,c++14,c++17 %s readability-redundant-casting %t -- -- -fno-delayed-template-parsing
2 // RUN: %check_clang_tidy -std=c++11,c++14,c++17 -check-suffix=,MACROS %s readability-redundant-casting %t -- \
3 // RUN: -config='{CheckOptions: { readability-redundant-casting.IgnoreMacros: false }}' \
5 // RUN: %check_clang_tidy -std=c++11,c++14,c++17 -check-suffix=,ALIASES %s readability-redundant-casting %t -- \
6 // RUN: -config='{CheckOptions: { readability-redundant-casting.IgnoreTypeAliases: true }}' \
8 // RUN: %check_clang_tidy -std=c++20 %s readability-redundant-casting %t -- \
10 // RUN: %check_clang_tidy -std=c++20 -check-suffix=,MACROS %s readability-redundant-casting %t -- \
11 // RUN: -config='{CheckOptions: { readability-redundant-casting.IgnoreMacros: false }}' \
13 // RUN: %check_clang_tidy -std=c++20 -check-suffix=,ALIASES %s readability-redundant-casting %t -- \ in testRedundantStaticCasting()
14 // RUN: -config='{CheckOptions: { readability-redundant-casting in testRedundantStaticCasting()
[all...]
/llvm-project/clang-tools-extra/test/clang-tidy/checkers/bugprone/
H A Dincorrect-roundings.cpp12 …// CHECK-MESSAGES: [[@LINE-1]]:7: warning: casting (double + 0.5) to integer leads to incorrect ro… in f1()
14 // CHECK-MESSAGES: [[@LINE-1]]:7: warning: casting (double + 0.5) in f1()
16 // CHECK-MESSAGES: [[@LINE-1]]:7: warning: casting (double + 0.5) in f1()
18 // CHECK-MESSAGES: [[@LINE-1]]:7: warning: casting (double + 0.5) in f1()
20 // CHECK-MESSAGES: [[@LINE-1]]:7: warning: casting (double + 0.5) in f1()
22 // CHECK-MESSAGES: [[@LINE-1]]:7: warning: casting (double + 0.5) in f1()
24 // CHECK-MESSAGES: [[@LINE-1]]:7: warning: casting (double + 0.5) in f1()
26 // CHECK-MESSAGES: [[@LINE-1]]:7: warning: casting (double + 0.5) in f1()
28 // CHECK-MESSAGES: [[@LINE-1]]:7: warning: casting (double + 0.5) in f1()
30 // CHECK-MESSAGES: [[@LINE-1]]:7: warning: casting (double + 0.5) in f1()
[all …]
H A Dcasting-through-void.cpp1 // RUN: %check_clang_tidy %s bugprone-casting-through-void %t
13 // CHECK-MESSAGES: :[[@LINE-1]]:22: warning: do not cast 'double *' to 'int *' through 'void *'; use reinterpret_cast instead [bugprone-casting-through-void] in normal_test()
15 // CHECK-MESSAGES: :[[@LINE-1]]:22: warning: do not cast 'double *' to 'int *' through 'V' (aka 'void *'); use reinterpret_cast instead [bugprone-casting-through-void] in normal_test()
17 // CHECK-MESSAGES: :[[@LINE-1]]:22: warning: do not cast 'int *' to 'int *' through 'void *'; use reinterpret_cast instead [bugprone-casting-through-void] in normal_test()
24 // CHECK-MESSAGES: :[[@LINE-1]]:27: warning: do not cast 'double *' to 'int *const' through 'void *'; use reinterpret_cast instead [bugprone-casting-through-void] in const_pointer_test()
26 // CHECK-MESSAGES: :[[@LINE-1]]:27: warning: do not cast 'double *' to 'int *const' through 'V' (aka 'void *'); use reinterpret_cast instead [bugprone-casting-through-void] in const_pointer_test()
28 // CHECK-MESSAGES: :[[@LINE-1]]:27: warning: do not cast 'int *' to 'int *const' through 'void *'; use reinterpret_cast instead [bugprone-casting-through-void] in const_pointer_test()
35 // CHECK-MESSAGES: :[[@LINE-1]]:28: warning: do not cast 'double *' to 'const int *' through 'const void *'; use reinterpret_cast instead [bugprone-casting-through-void] in const_test()
37 // CHECK-MESSAGES: :[[@LINE-1]]:28: warning: do not cast 'double *' to 'const int *' through 'const V' (aka 'void *const'); use reinterpret_cast instead [bugprone-casting-through-void] in const_test()
39 // CHECK-MESSAGES: :[[@LINE-1]]:28: warning: do not cast 'int *' to 'const int *' through 'const void *'; use reinterpret_cast instead [bugprone-casting in const_test()
[all...]
H A Dsigned-char-misuse.cpp19 …// CHECK-MESSAGES: [[@LINE-1]]:20: warning: 'signed char' to 'int' conversion; consider casting to… in SimpleVarDeclaration()
28 …// CHECK-MESSAGES: [[@LINE-1]]:16: warning: 'signed char' to 'int' conversion; consider casting to… in SimpleAssignment()
37 …// CHECK-MESSAGES: [[@LINE-1]]:21: warning: 'signed char' to 'int' conversion; consider casting to… in CStyleCast()
46 …// CHECK-MESSAGES: [[@LINE-1]]:33: warning: 'signed char' to 'int' conversion; consider casting to… in StaticCast()
55 …// CHECK-MESSAGES: [[@LINE-1]]:20: warning: 'signed char' to 'int' conversion; consider casting to… in FunctionalCast()
63 …// CHECK-MESSAGES: [[@LINE-1]]:20: warning: 'signed char' to 'int' conversion; consider casting to… in NegativeConstValue()
70 …// CHECK-MESSAGES: [[@LINE-1]]:20: warning: 'signed char' to 'int' conversion; consider casting to… in CharPointer()
106 … 'signed char' to 'unsigned int' conversion in array subscript; consider casting to 'unsigned char… in SignedCharCArraySubscript()
110 … 'signed char' to 'unsigned int' conversion in array subscript; consider casting to 'unsigned char… in SignedCharSTDArraySubscript()
H A Dsigned-char-misuse-with-option.cpp14 …// CHECK-MESSAGES: [[@LINE-1]]:16: warning: 'signed char' to 'int' conversion; consider casting to… in SimpleAssignment()
24 …// CHECK-MESSAGES: [[@LINE-1]]:20: warning: 'signed char' to 'int' conversion; consider casting to… in TypedefNotInIgnorableList()
71 …// CHECK-MESSAGES: [[@LINE-1]]:20: warning: 'signed char' to 'int' conversion; consider casting to… in DereferenceWithTypdef()
/llvm-project/clang/test/Analysis/
H A DDeleteWithNonVirtualDtor.cpp36 NonVirtual *x = new NVDerived(); // expected-note{{Casting from 'NVDerived' to 'NonVirtual' here}} in create()
55 sd = new NVDerived(); // expected-note{{Casting from 'NVDerived' to 'NonVirtual' here}} in singleDerived()
61 …NonVirtual *sda = new NVDerived[5]; // expected-note{{Casting from 'NVDerived' to 'NonVirtual' her… in singleDerivedArr()
67 …NonVirtual *dd = new NVDoubleDerived(); // expected-note{{Casting from 'NVDoubleDerived' to 'NonVi… in doubleDerived()
73 NonVirtual *atf = get(); // expected-note{{Casting from 'NVDerived' to 'NonVirtual' here}} in assignThroughFunction()
80 atf2 = get(); // expected-note{{Casting from 'NVDerived' to 'NonVirtual' here}} in assignThroughFunction2()
93 …NonVirtual *dtf = new NVDerived(); // expected-note{{Casting from 'NVDerived' to 'NonVirtual' here… in deleteThroughFunction()
99 …NonVirtual *sccs2 = (NonVirtual*)sccs; // expected-note{{Casting from 'NVDerived' to 'NonVirtual' … in singleCastCStyle()
105 …NonVirtual *dccs = new NVDerived(); // expected-note{{Casting from 'NVDerived' to 'NonVirtual' her… in doubleCastCStyle()
106 …NVDerived *dccs2 = (NVDerived*)dccs; // expected-note{{Casting from 'NonVirtual' to 'NVDerived' he… in doubleCastCStyle()
[all …]
H A DArrayDelete.cpp14 Base *b = new Derived[3]; // expected-note{{Casting from 'Derived' to 'Base' here}} in create()
32 Base *sd = new Derived[10]; // expected-note{{Casting from 'Derived' to 'Base' here}} in same_function()
36 … Base *dd = new DoubleDerived[10]; // expected-note{{Casting from 'DoubleDerived' to 'Base' here}} in same_function()
42 Base *assigned = get(); // expected-note{{Casting from 'Derived' to 'Base' here}} in different_function()
47 indirect = get(); // expected-note{{Casting from 'Derived' to 'Base' here}} in different_function()
56 Base *sb = new Derived[10]; // expected-note{{Casting from 'Derived' to 'Base' here}} in different_function()
75 Base *b = new DoubleDerived[10]; // expected-note{{Casting from 'DoubleDerived' to 'Base' here}} in multiple_derived()
79 … Base *b2 = new DoubleDerived[10]; // expected-note{{Casting from 'DoubleDerived' to 'Base' here}} in multiple_derived()
80 … Derived *d2 = static_cast<Derived*>(b2); // expected-note{{Casting from 'Base' to 'Derived' here}} in multiple_derived()
84 …Derived *d3 = new DoubleDerived[10]; // expected-note{{Casting from 'DoubleDerived' to 'Derived' h… in multiple_derived()
[all …]
H A Dcast-to-struct.cpp30 …Abc = (struct ABC *)&Ab; // expected-warning {{Casting data to a larger structure type and accessi… in structToStruct()
39 // True negatives when casting from Base to Derived. in structToStruct()
46 // True positives when casting from Base to Derived. in structToStruct()
48 …D2 = (Derived *)&B2;// expected-warning {{Casting data to a larger structure type and accessing a … in structToStruct()
49 …D2 = dynamic_cast<Derived *>(&B2);// expected-warning {{Casting data to a larger structure type an… in structToStruct()
50 …D2 = static_cast<Derived *>(&B2);// expected-warning {{Casting data to a larger structure type and… in structToStruct()
62 …Abc = (struct ABC *)P; // expected-warning {{Casting a non-structure type to a structure type and … in intToStruct()
/llvm-project/clang/test/Frontend/
H A Dnoderef.cpp33 int *i_ptr5 = i_ptr; // expected-warning{{casting to dereferenceable pointer removes 'noderef' attribute}} in Normal()
34 int *i_ptr6(i_ptr); // expected-warning{{casting to dereferenceable pointer removes 'noderef' attribute}} in Normal()
93 A(NODEREF int *x) : member4(x) {} // expected-warning{{casting to dereferenceable pointer removes 'noderef' attribute}} in A()
138 int *a = static_cast<int *>(x); // expected-warning{{casting to dereferenceable pointer removes 'noderef' attribute}} in cast_from_void_ptr()
147 int *x2 = x; // expected-warning{{casting to dereferenceable pointer removes 'noderef' attribute}} in conversion_sequences()
148 int *x3 = static_cast<int *>(x); // expected-warning{{casting to dereferenceable pointer removes 'noderef' attribute}} in conversion_sequences()
156 Child *child2 = dynamic_cast<Child *>(child); // expected-warning{{casting to dereferenceable pointer removes 'noderef' attribute}} in conversion_sequences()
160 return static_cast<int *>(x); // expected-warning{{casting to dereferenceable pointer removes 'noderef' attribute}} in static_cast_from_same_ptr_type()
164 return dynamic_cast<A *>(child); // expected-warning{{casting to dereferenceable pointer removes 'noderef' attribute}} in dynamic_cast_up()
168 return dynamic_cast<Child *>(a); // expected-warning{{casting t in dynamic_cast_down()
[all...]
H A Dnoderef.c75 …p2 = &s->a; // expected-warning{{casting to dereferenceable pointer removes 'noderef' attribute}} in test()
76 …p2 = &(*s).a; // expected-warning{{casting to dereferenceable pointer removes 'noderef' attribute}} in test()
128 // Casting to dereferenceable pointer in test()
129 …p2 = p; // expected-warning{{casting to dereferenceable pointer removes 'noderef' attr… in test()
130 …p2 = *q; // expected-warning{{casting to dereferenceable pointer removes 'noderef' attr… in test()
131 …p2 = q[0]; // expected-warning{{casting to dereferenceable pointer removes 'noderef' attr… in test()
132 …s2 = s2_arr[1]; // expected-warning{{casting to dereferenceable pointer removes 'noderef' attr… in test()
133 …s2 = s2_arr2[1][1]; // expected-warning{{casting to dereferenceable pointer removes 'noderef' attr… in test()
134 …p2 = p, p2 = *q; // expected-warning 2 {{casting to dereferenceable pointer removes 'noderef' a… in test()
190 // Casting is ok in test()
/llvm-project/clang-tools-extra/docs/clang-tidy/checks/readability/
H A Dredundant-casting.rst1 .. title:: clang-tidy - readability-redundant-casting
3 readability-redundant-casting
6 Detects explicit type casting operations that involve the same source and
8 explicit casting operations, including ``static_cast``, ``const_cast``, C-style
10 readability and maintainability by eliminating unnecessary type casting.
20 Casting operations involving constructor conversions, user-defined conversions,
/llvm-project/mlir/python/mlir/dialects/linalg/opdsl/ops/
H A Dcore_named_ops.py17 Numeric casting is performed on the input operand, promoting it to the same
33 Numeric casting is performed on the input operand, promoting it to the same
46 No numeric casting is performed on the input operand.
58 No numeric casting is performed on the input operand.
70 No numeric casting is performed on the input operand.
82 No numeric casting is performed on the input operand.
94 No numeric casting is performed on the input operand.
106 No numeric casting is performed on the input operand.
118 No numeric casting is performed on the input operand.
130 No numeric casting i
[all...]
/llvm-project/clang-tools-extra/test/clang-tidy/checkers/google/
H A Dreadability-casting.c1 // RUN: %check_clang_tidy %s google-readability-casting %t -- -- -x c
4 // RUN: clang-tidy --checks=-*,google-readability-casting %s -- -x c++ | FileCheck %s -check-prefix…
6 // RUN: clang-tidy --checks=-*,google-readability-casting -header-filter='.*' %t.main_file.cpp -- -…
11 #include "readability-casting.c"
17 …CK-MESSAGES: :[[@LINE-1]]:22: warning: redundant cast to the same type [google-readability-casting] in f()
/llvm-project/clang/test/SemaOpenCL/
H A Daddress-spaces.cl40 // expected-error@-2 {{casting '__local int *' to type '__global int *' changes address space of po…
46 // expected-error@-2 {{casting '__constant int *' to type '__global int *' changes address space of…
52 // expected-error@-2 {{casting 'const __constant int *' to type '__global int *' changes address sp…
58 // expected-error@-2 {{casting '__private int *' to type '__global int *' changes address space of …
64 // expected-error@-2 {{casting '__global int *' to type '__local int *' changes address space of po…
70 // expected-error@-2 {{casting '__constant int *' to type '__local int *' changes address space of …
76 // expected-error@-2 {{casting 'const __constant int *' to type '__local int *' changes address spa…
82 // expected-error@-2 {{casting '__private int *' to type '__local int *' changes address space of p…
88 // expected-error@-2 {{casting '__global int *' to type '__constant int *' changes address space of…
94 // expected-error@-2 {{casting '__local int *' to type '__constant int *' changes address space of …
[all …]
H A Daddress-spaces-conversions-cl2.0.cl141 // expected-error@-3{{casting '__global int *' to type '__constant int *' changes address space of …
150 // expected-error-re@-3{{casting '__local int *' to type '__{{global|constant}} int *' changes addr…
159 // expected-error-re@-3{{casting '__constant int *' to type '__{{global|generic}} int *' changes ad…
168 // expected-error-re@-3{{casting '__private int *' to type '__{{global|constant}} int *' changes ad…
177 // expected-error@-3{{casting '__generic int *' to type '__constant int *' changes address space of…
232 // expected-error@-3{{casting '__global int *' to type '__constant int *' changes address space of …
241 // expected-error-re@-3{{casting '__local int *' to type '__{{global|constant}} int *' changes addr…
250 // expected-error-re@-3{{casting '__constant int *' to type '__{{global|generic}} int *' changes ad…
259 // expected-error-re@-3{{casting '__private int *' to type '__{{global|constant}} int *' changes ad…
268 // expected-error@-3{{casting '__generic int *' to type '__constant int *' changes address space of…
[all …]
/llvm-project/mlir/include/mlir/Dialect/LLVMIR/
H A DLLVMAttrs.h31 // Support LLVM type casting.
40 /// Support LLVM type casting.
50 /// Support LLVM type casting.
59 /// Support LLVM type casting.
68 /// Support LLVM type casting.
77 /// Support LLVM type casting.
/llvm-project/clang-tools-extra/docs/clang-tidy/checks/google/
H A Dreadability-casting.rst1 .. title:: clang-tidy - google-readability-casting
3 google-readability-casting
8 https://google.github.io/styleguide/cppguide.html#Casting
10 Corresponding cpplint.py check name: `readability/casting`.
/llvm-project/clang-tools-extra/docs/clang-tidy/checks/bugprone/
H A Dcasting-through-void.rst1 .. title:: clang-tidy - bugprone-casting-through-void
3 bugprone-casting-through-void
6 Detects unsafe or redundant two-step casting operations involving ``void*``,
/llvm-project/clang-tools-extra/test/clang-tidy/infrastructure/
H A Dnolintbeginend-LIFO.cpp1 // RUN: not clang-tidy %s --checks='-*,google-explicit-constructor,google-readability-casting' 2>&1…
4 // NOLINTBEGIN(google-readability-casting)
8 // NOLINTEND(google-readability-casting)
H A Dnolintbeginend-begin-multiple-end-single.cpp1 // RUN: not clang-tidy %s --checks='-*,google-explicit-constructor,google-readability-casting' 2>&1…
3 // NOLINTBEGIN(google-explicit-constructor,google-readability-casting)
7 // NOLINTEND(google-readability-casting)
H A Dnolintbeginend-begin-single-end-multiple.cpp1 // RUN: not clang-tidy %s --checks='-*,google-explicit-constructor,google-readability-casting' 2>&1…
4 // NOLINTBEGIN(google-readability-casting)
7 // NOLINTEND(google-explicit-constructor,google-readability-casting)
/llvm-project/mlir/include/mlir/Dialect/Linalg/IR/
H A DLinalgNamedStructuredOps.yaml10 Numeric casting is performed on the input operand, promoting it to the same
53 Numeric casting is performed on the input operand, promoting it to the same
103 No numeric casting is performed on the input operand.
138 No numeric casting is performed on the input operand.
173 No numeric casting is performed on the input operand.
208 No numeric casting is performed on the input operand.
243 No numeric casting is performed on the input operand.
278 No numeric casting is performed on the input operand.
313 No numeric casting is performed on the input operand.
348 No numeric casting i
[all...]
/llvm-project/clang-tools-extra/clang-tidy/google/
H A DAvoidCStyleCastsCheck.h18 /// https://google.github.io/styleguide/cppguide.html#Casting
20 /// Corresponding cpplint.py check name: 'readability/casting'.
27 /// http://clang.llvm.org/extra/clang-tidy/checks/google/readability-casting.html
/llvm-project/mlir/lib/Conversion/PDLToPDLInterp/
H A DPredicateTree.h78 /// used directly, and is provided to support type casting.
99 /// A unique identifier for the derived matcher node, used for type casting.
115 /// support type casting.
142 /// support type casting.
159 /// support type casting.
188 /// support type casting.
/llvm-project/clang/test/Sema/
H A Dmatrix-type-operators.c21 …// expected-error@-2 {{casting 'sx10x5_t *' (aka 'float __attribute__((matrix_type(10, 5)))*') to… in add()
25 …// expected-error@-2 {{casting 'sx10x5_t *' (aka 'float __attribute__((matrix_type(10, 5)))*') to… in add()
42 …// expected-error@-2 {{casting 'sx10x5_t *' (aka 'float __attribute__((matrix_type(10, 5)))*') to… in sub()
46 …// expected-error@-2 {{casting 'sx10x5_t *' (aka 'float __attribute__((matrix_type(10, 5)))*') to… in sub()
81 // expected-error@-1 {{casting 'char *' to incompatible type 'float'}} in mat_scalar_multiply()
84 // expected-error@-1 {{casting 'char *' to incompatible type 'float'}} in mat_scalar_multiply()
87 // expected-error@-1 {{casting 'char *' to incompatible type 'float'}} in mat_scalar_multiply()
90 // expected-error@-1 {{casting 'char *' to incompatible type 'float'}} in mat_scalar_multiply()

12345678910>>...44