summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/vector-casts.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [Sema] Be consistent about diagnostic wording: always use "cannot".Davide Italiano2015-08-151-2/+2
| | | | | | Discussed with Richard Smith. llvm-svn: 245162
* Fix the equal-vector-size rule for reinterpret_casts in C++John McCall2015-07-231-2/+20
| | | | | | | | | | | | | to consider the storage size of the vector instead of its sizeof. In other words, ban <3 x int> to <4 x int> casts, which produced invalid IR anyway. Also, attempt to be a little more rigorous, or at least explicit, about when enums are allowed in these casts. rdar://21901132 llvm-svn: 243069
* Print detailed vector type information on diagnostics.Benjamin Kramer2014-04-251-11/+11
| | | | | | | | | | | | | | | | | | | | | | We never aka vector types because our attributed syntax for it is less comprehensible than the typedefs. This leaves the user in the dark when the typedef isn't named that well. Example: v2s v; v4f w; w = v; The naming in this cases isn't even that bad, but the error we give is useless without looking up the actual typedefs. t.c:6:5: error: assigning to 'v4f' from incompatible type 'v2s' Now: t.c:6:5: error: assigning to 'v4f' (vector of 4 'float' values) from incompatible type 'v2s' (vector of 2 'int' values) We do this for all diagnostics that print a vector type. llvm-svn: 207267
* Tighten lax vector-conversion rules and enforce them consistently.John McCall2014-02-041-0/+17
| | | | | | | | | | | | | | | | | | | | When a lax conversion featured a vector and a non-vector, we were only requiring the non-vector to be a scalar type, but really it needs to be a real type (i.e. integral or real floating); it is not reasonable to allow a pointer, member pointer, or complex type here. r198474 required lax conversions to match in "data size", i.e. element size * element count, forbidding matches that happen only because a vector is rounded up to the nearest power of two in size. Unfortunately, the erroneous logic was repeated in several different places; unify them to use the new condition, so that it triggers for arbitrary conversions and not just those performed as part of binary operator checking. rdar://15931426 llvm-svn: 200810
* For areVectorOperandsLaxBitCastable(), only return false if both opearands ↵Argyrios Kyrtzidis2014-01-071-1/+9
| | | | | | | | | | are vector types and add a diagnostic when the operand is a vector and non-scalar value. rdar://15722301 llvm-svn: 198680
* Provide overload diagnostics when explicit casts involving class types fail.John McCall2011-02-141-3/+3
| | | | | | PR8626. llvm-svn: 125506
* When pretty-printing tag types, only print the tag if we're in C (andJohn McCall2010-03-101-4/+4
| | | | | | | | | | therefore not creating ElaboratedTypes, which are still pretty-printed with the written tag). Most of these testcase changes were done by script, so don't feel too sorry for my fingers. llvm-svn: 98149
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-151-1/+1
| | | | | | | | | - This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target). llvm-svn: 91446
* Improve handling of vector casts in C++.Anders Carlsson2009-09-161-0/+40
llvm-svn: 82072
OpenPOWER on IntegriCloud