summaryrefslogtreecommitdiff
path: root/unittests/Support/Casting.cpp
Commit message (Collapse)AuthorAge
* [C++11] Replace LLVM-style type traits with C++11 standard ones.Benjamin Kramer2014-03-07
| | | | | | No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203242 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-sort all of the includes with ./utils/sort_includes.py so thatChandler Carruth2014-01-07
| | | | | | | | | | subsequent changes are easier to review. About to fix some layering issues, and wanted to separate out the necessary churn. Also comment and sink the include of "Windows.h" in three .inc files to match the usage in Memory.inc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198685 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a regression I introduced back in r178147.Rafael Espindola2013-07-18
| | | | | | | | | | | We don't want cast and dyn_cast to work on temporaries. They don't extend lifetime like a direct bind to a reference would, so they can introduce hard to find bugs. I added tests to make sure we don't regress this. Thanks to Eli Friedman for noticing this and for his suggestions on how to test it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186559 91177308-0d34-0410-b5e6-96231b3b80d8
* Sort the #include lines for unittest/...Chandler Carruth2012-12-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169250 91177308-0d34-0410-b5e6-96231b3b80d8
* Casting.h: Automatically handle isa<Base>(Derived).Sean Silva2012-10-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Additionally, all such cases are handled with no dynamic check. All `classof()` of the form class Foo { [...] static bool classof(const Bar *) { return true; } [...] } where Foo is an ancestor of Bar are no longer necessary. Don't write them! Note: The exact test is `is_base_of<Foo, Bar>`, which is non-strict, so that Foo is considered an ancestor of itself. This leads to the following rule of thumb for LLVM-style RTTI: The argument type of `classof()` should be a strict ancestor. For more information about implementing LLVM-style RTTI, see docs/HowToSetUpLLVMStyleRTTI.rst git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165765 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't pass a null pointer to cast<> in its unit tests.Richard Smith2012-08-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162310 91177308-0d34-0410-b5e6-96231b3b80d8
* unittests/Support/Casting.cpp: [PR8226] Workaround for MSVC|Debug.NAKAMURA Takumi2012-01-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148659 91177308-0d34-0410-b5e6-96231b3b80d8
* add dyn_cast_or_null tests, exclude invalid dyn_cast testGabor Greif2010-07-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109111 91177308-0d34-0410-b5e6-96231b3b80d8
* tidy upGabor Greif2010-07-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109110 91177308-0d34-0410-b5e6-96231b3b80d8
* add dyn_cast tests and beef up others a bitGabor Greif2010-07-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109109 91177308-0d34-0410-b5e6-96231b3b80d8
* tidy upGabor Greif2010-07-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108889 91177308-0d34-0410-b5e6-96231b3b80d8
* migrate essentially everything from under #ifdef DEBUG_CAST_OPERATORS into ↵Gabor Greif2010-07-20
| | | | | | this file git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108864 91177308-0d34-0410-b5e6-96231b3b80d8
* extend to cast<> and cast_or_null<> testsGabor Greif2010-07-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108854 91177308-0d34-0410-b5e6-96231b3b80d8
* isa<> testsGabor Greif2010-07-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108851 91177308-0d34-0410-b5e6-96231b3b80d8
* initial checkin for unittest to exercise Support/Casting.hGabor Greif2010-07-20
this is still minimal on purpose, but I plan to migrate the ugly hack under #ifdef DEBUG_CAST_OPERATORS into this file git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108849 91177308-0d34-0410-b5e6-96231b3b80d8