summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/vector.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [Clang][Sema]Choose a better candidate in overload function call if there is ↵Zi Xuan Wu2018-11-161-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | a compatible vector conversion instead of ambiguous call error There are 2 function variations with vector type parameter. When we call them with argument of different vector type we would prefer to choose the variation with implicit argument conversion of compatible vector type instead of incompatible vector type. For example, typedef float __v4sf __attribute__((__vector_size__(16))); void f(vector float); void f(vector signed int); int main { __v4sf a; f(a); } Here, we'd like to choose f(vector float) but not report an ambiguous call error. Differential revision: https://reviews.llvm.org/D53417 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347019 91177308-0d34-0410-b5e6-96231b3b80d8
* PR15730/PR16986 Allow dependently typed vector_size types.Erich Keane2018-07-131-0/+43
| | | | | | | | | | | | | | | | | | As listed in the above PRs, vector_size doesn't allow dependent types/values. This patch introduces a new DependentVectorType to handle a VectorType that has a dependent size or type. In the future, ALL the vector-types should be able to create one of these to handle dependent types/sizes as well. For example, DependentSizedExtVectorType could likely be switched to just use this instead, though that is left as an exercise for the future. Differential Revision: https://reviews.llvm.org/D49045 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@337036 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert -r336726, which included more files than intended.Erich Keane2018-07-101-43/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@336727 91177308-0d34-0410-b5e6-96231b3b80d8
* [NFC] Switch CodeGenFunction to use value init instead of member init listsErich Keane2018-07-101-0/+43
| | | | | | | | | The member init list for the sole constructor for CodeGenFunction has gotten out of hand, so this patch moves the non-parameter-dependent initializations into the member value inits. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@336726 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typos in clangAlexander Kornienko2018-04-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found via codespell -q 3 -I ../clang-whitelist.txt Where whitelist consists of: archtype cas classs checkk compres definit frome iff inteval ith lod methode nd optin ot pres statics te thru Patch by luzpaz! (This is a subset of D44188 that applies cleanly with a few files that have dubious fixes reverted.) Differential revision: https://reviews.llvm.org/D44188 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@329399 91177308-0d34-0410-b5e6-96231b3b80d8
* [Lit Test] Updated 34 Lit tests to be C++11 compatible.Charles Li2015-11-171-1/+7
| | | | | | | Added expected diagnostics new to C++11. Expanded RUN line to: default, C++98/03 and C++11. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253371 91177308-0d34-0410-b5e6-96231b3b80d8
* Print detailed vector type information on diagnostics.Benjamin Kramer2014-04-251-5/+5
| | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207267 91177308-0d34-0410-b5e6-96231b3b80d8
* vector_size cannot be applied to Booleans. Updated the semantic checking ↵Aaron Ballman2013-09-131-6/+9
| | | | | | logic, as well as the comment and added a test case. Fixes PR12649 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190721 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Expr::Classify to correctly classify ExtVectorElementExprs. PR16204.Eli Friedman2013-06-171-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184123 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow vector types in pseudo-destructor expressions. Fixes PR13798.Douglas Gregor2012-09-101-0/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163514 91177308-0d34-0410-b5e6-96231b3b80d8
* Add (hopefully) the last missing lvalue-to-rvalue conversion. Add an assertionRichard Smith2011-10-281-0/+49
| | | | | | | to catch some future implicit lvalue-to-rvalue casts of inappropriate kinds. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143182 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Sema::CheckVectorOperands so that it doesn't try to insert a cast ↵Eli Friedman2011-06-231-4/+4
| | | | | | | | | | expression into the LHS of a compound assignment. Fixes compound assignment of various "compatible" vector types, including NEON-vector and gcc-vector types. <rdar://problem/9640356> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133737 91177308-0d34-0410-b5e6-96231b3b80d8
* With lax vector conversions (the default) make sure we convert between twoEric Christopher2010-08-261-6/+8
| | | | | | | | | | vectors that are the same size. Fix up testcases accordingly and add a new one to make sure we still error if lax vector conversions are disabled. Fixes rdar://8328190 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112122 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't allow vector conversions to sneak in under the guise ofDouglas Gregor2010-06-221-0/+30
| | | | | | | | | floating-point conversions or floating-integral conversions. We really, really, really need to make isFloatingType() and friends not apply to vector types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106551 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement C++ builtin operator candidates for vector types.Douglas Gregor2010-05-191-4/+70
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104105 91177308-0d34-0410-b5e6-96231b3b80d8
* Basic test for user-defined conversions involving vector typesDouglas Gregor2010-05-181-3/+23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104085 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement C++ support for vector and extended vector types. ThisDouglas Gregor2010-05-181-0/+102
involves extending implicit conversion sequences to model vector conversions and vector splats, along with teaching the C++ conditional operator-checking code about vector types. Fixes <rdar://problem/7983501>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104081 91177308-0d34-0410-b5e6-96231b3b80d8