summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/expr/expr.unary/expr.unary.op/p6.cpp
Commit message (Collapse)AuthorAgeFilesLines
* PR16074, implement warnings to catch pointer to boolean true and pointer toRichard Trieu2014-02-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | null comparison when the pointer is known to be non-null. This catches the array to pointer decay, function to pointer decay and address of variables. This does not catch address of function since this has been previously used to silence a warning. Pointer to bool conversion is under -Wbool-conversion. Pointer to null comparison is under -Wtautological-pointer-compare, a sub-group of -Wtautological-compare. void foo() { int arr[5]; int x; // warn on these conditionals if (foo); if (arr); if (&x); if (foo == null); if (arr == null); if (&x == null); if (&foo); // no warning } llvm-svn: 202216
* Improve some of the conversion warnings to fire on conversion to bool.David Blaikie2012-05-151-1/+1
| | | | | | | | | | | Moves the bool bail-out down a little in SemaChecking - so now -Wnull-conversion and -Wliteral-conversion can fire when the target type is bool. Also improve the wording/details in the -Wliteral-conversion warning to match the -Wconstant-conversion. llvm-svn: 156826
* Allow calling an overloaded function set by taking the address of theDouglas Gregor2011-10-131-3/+2
| | | | | | functions, e.g., (&f)(0). Fixes <rdar://problem/9803316>. llvm-svn: 141877
* Catch placeholder types in DefaultLvalueConversionJohn McCall2011-10-111-3/+3
| | | | | | | | | | | and DefaultFunctionArrayLvalueConversion. To prevent significant regression for should-this-be-a-call fixits, and to repair some such regression from the introduction of bound member placeholders, make those placeholder checks try to build calls appropriately. Harden the build-a-call logic while we're at it. llvm-svn: 141738
* Clean up our handling of template-ids that resolve down to a singleDouglas Gregor2011-03-161-3/+3
| | | | | | | | | overload, so that we actually do the resolution for full expressions and emit more consistent, useful diagnostics. Also fixes an IRGen crasher, where Sema wouldn't diagnose a resolvable bound member function template-id used in a full-expression (<rdar://problem/9108698>). llvm-svn: 127747
* Progress.John McCall2010-10-121-1/+1
| | | | llvm-svn: 116287
* Check that an overloaded function name, when used by the ! operator,Douglas Gregor2010-09-201-0/+36
actually resolves to a particular function. Fixes PR8181, from Faisal Vali! llvm-svn: 114331
OpenPOWER on IntegriCloud