summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/expr/expr.unary
Commit message (Collapse)AuthorAgeFilesLines
* P0620 follow-up: deducing `auto` from braced-init-list in new exprZhihao Yuan2017-12-113-2/+25
| | | | | | | | | | | | | | | | | | | Summary: This is a side-effect brought in by p0620r0, which allows other placeholder types (derived from `auto` and `decltype(auto)`) to be usable in a `new` expression with a single-clause //braced-init-list// as its initializer (8.3.4 [expr.new]/2). N3922 defined its semantics. References: http://wg21.link/p0620r0 http://wg21.link/n3922 Reviewers: rsmith, aaron.ballman Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D39451 llvm-svn: 320401
* Re-commit r283722, reverted in r283750, with a fix for a CUDA-specific use ofRichard Smith2016-10-103-1/+150
| | | | | | | | | | | past-the-end iterator. Original commit message: P0035R4: Semantic analysis and code generation for C++17 overaligned allocation. llvm-svn: 283789
* Revert "P0035R4: Semantic analysis and code generation for C++17 overaligned ↵Daniel Jasper2016-10-103-150/+1
| | | | | | | | | | | | allocation." This reverts commit r283722. Breaks: Clang.SemaCUDA.device-var-init.cu Clang.CodeGenCUDA.device-var-init.cu http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-expensive/884/ llvm-svn: 283750
* P0035R4: Semantic analysis and code generation for C++17 overalignedRichard Smith2016-10-103-1/+150
| | | | | | allocation. llvm-svn: 283722
* [Sema] Be consistent about diagnostic wording: always use "cannot".Davide Italiano2015-08-151-1/+1
| | | | | | Discussed with Richard Smith. llvm-svn: 245162
* Revert "Revert r241620 and follow-up commits" and move the initializationAdrian Prantl2015-07-081-0/+1
| | | | | | of the llvm targets from clang/CodeGen into ClangCheck.cpp and CIndex.cpp. llvm-svn: 241653
* Revert r241620 and follow-up commits while investigating linux buildbot ↵Adrian Prantl2015-07-071-1/+0
| | | | | | failures. llvm-svn: 241642
* Wrap clang modules and pch files in an object file container.Adrian Prantl2015-07-071-0/+1
| | | | | | | | | | | | | This patch adds ObjectFilePCHContainerOperations uses the LLVM backend to put the contents of a PCH into a __clangast section inside a COFF, ELF, or Mach-O object file container. This is done to facilitate module debugging by makeing it possible to store the debug info for the types defined by a module alongside the AST. rdar://problem/20091852 llvm-svn: 241620
* Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."Adrian Prantl2015-02-251-1/+0
| | | | llvm-svn: 230454
* Wrap clang module files in a Mach-O, ELF, or COFF container.Adrian Prantl2015-02-251-0/+1
| | | | | | | | | | | | | | | | | This is a necessary prerequisite for debugging with modules. The .pcm files become containers that hold the serialized AST which allows us to store debug information in the module file that can be shared by all object files that were built importing the module. This reapplies r230044 with a fixed configure+make build and updated dependencies and testcase requirements. Over the last iteration this version adds - missing target requirements for testcases that specify an x86 triple, - a missing clangCodeGen.a dependency to libClang.a in the make build. rdar://problem/19104245 llvm-svn: 230423
* Adding a -Wunused-value warning for expressions with side effects used in an ↵Aaron Ballman2014-12-171-1/+1
| | | | | | unevaluated expression context, such as sizeof(), or decltype(). Also adds a similar warning when the expression passed to typeid() *is* evaluated, since it is equally likely that the user would expect the expression operand to be unevaluated in that case. llvm-svn: 224465
* DR1346: a parenthesized braced-init-list cannot be used as the initializer whenRichard Smith2014-03-121-0/+2
| | | | | | performing auto type deduction. llvm-svn: 203683
* 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
* Revert "Don't require -re suffix on -verify directives with regexes."Alp Toker2013-12-141-1/+1
| | | | | | | | | | This patch was submitted to the list for review and didn't receive a LGTM. (In fact one explicit objection and one query were raised.) This reverts commit r197295. llvm-svn: 197299
* Don't require -re suffix on -verify directives with regexes.Hans Wennborg2013-12-141-1/+1
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D2392 llvm-svn: 197295
* Tighten test regexes checking for __attribute__((thiscall)) on function types.Hans Wennborg2013-12-131-1/+1
| | | | | | | | | | | The tests were perhaps made too relaxed in r197164 when we switched to the new MinGW ABI. This makes sure we check explicitly for an optional thiscall attribute and nothing else. We should still look into whether we should print these attributes at all in these cases. llvm-svn: 197252
* Switch to the new MingW ABI.Rafael Espindola2013-12-121-1/+1
| | | | | | | GCC 4.7 changed the MingW ABI. On the clang side this means that methods now have the thiscall calling convention by default. llvm-svn: 197164
* Make wording for certain invalid unary expressions more consistent.David Majnemer2013-10-091-1/+1
| | | | | | | | | | An invalid decltype expression like 'decltype int' gives: error: expected '(' after 'decltype' This makes it so 'sizeof int' gives a similar one: error: expected parentheses around type name in sizeof expression llvm-svn: 192258
* Fixed messages in tests.Serge Pavlov2013-10-081-1/+1
| | | | llvm-svn: 192208
* Add fixits suggesting parenthesis around type name in expressions like sizeof.Serge Pavlov2013-10-081-0/+20
| | | | | | This fixes PR16992 - Fixit missing when "sizeof type" found. llvm-svn: 192200
* Mark that qualifiers can prefix the auto type. This seems to just haveChandler Carruth2013-09-021-1/+1
| | | | | | | | | | | | | | | | | | been an oversight, as it definitely works. Every test which changed had the const written on the LHS of the auto already. Notably, this also makes things like cpp11-migrate's formation of 'const auto &' variables much more familiar. Yes, many people feel that 'const' and other qualifiers belong on the RHS of the type. I'm not going to argue about that because Clang already *overwhelming* places the qualifiers on the LHS when it can and on the RHS when it must. We shouldn't diverge for auto. We should add a tool to clang-tidy that fixes this in either direction, and then wire up clang-tidy to tools like cpp11-migrate to fix their placement after transforms. llvm-svn: 189769
* sizeof(void) etc. should be a hard error in C++.Eli Friedman2013-08-131-0/+8
| | | | | | PR16872. llvm-svn: 188324
* Fix regression from r184810.Eli Friedman2013-06-251-0/+4
| | | | | | | Specifically, CallExpr::getCalleeDecl() can return null, so make sure to handle that correctly. llvm-svn: 184813
* Fix noexcept for delete expressions.Eli Friedman2013-06-251-1/+4
| | | | | | | Using "delete" on a pointer to an incomplete type can't throw. While I'm here, clean up the signature of the canCalleeThrow() helper. llvm-svn: 184810
* Implement DR61: Address of ambiguous bound methods should be disallowedDavid Majnemer2013-06-111-1/+3
| | | | | | | DR61 affirms that expressions containing unresolved member access should be disallowed when performing "address of" operations. llvm-svn: 183723
* Grab-bag of bit-field fixes:John McCall2013-05-061-0/+20
| | | | | | | | | | | | | | - References to ObjC bit-field ivars are bit-field lvalues; fixes rdar://13794269, which got me started down this. - Introduce Expr::refersToBitField, switch a couple users to it where semantically important, and comment the difference between this and the existing API. - Discourage Expr::getBitField by making it a bit longer and less general-sounding. - Lock down on const_casts of bit-field gl-values until we hear back from the committee as to whether they're allowed. llvm-svn: 181252
* Prior to adding the new "expected-no-diagnostics" directive to ↵Andy Gibbs2012-10-192-0/+2
| | | | | | VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive. llvm-svn: 166280
* 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
* Fix crash & accepts-invalid for array of arrays of user defined type.David Blaikie2012-03-102-0/+30
| | | | | | | Test case/other help by Richard Smith. Code review by John McCall. llvm-svn: 152519
* Don't consider an overloaded operator& when the expression is actuallyDouglas Gregor2011-12-141-0/+28
| | | | | | going to be a pointer-to-member constant. Fixes <rdar://problem/10544564>. llvm-svn: 146587
* Update all tests other than Driver/std.cpp to use -std=c++11 rather thanRichard Smith2011-10-135-7/+7
| | | | | | -std=c++0x. Patch by Ahmed Charles! llvm-svn: 141900
* 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
* PR9899: handle pseudo-destructors correctly in noexcept() expressions.Eli Friedman2011-05-121-0/+3
| | | | llvm-svn: 131220
* PR9882: Fix noexcept to deal with dependent new, delete, calls, andEli Friedman2011-05-111-0/+10
| | | | | | dynamic_cast correctly. llvm-svn: 131177
* 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
* Extend the noexcept expression test to test noexcept specification functions.Sebastian Redl2011-03-151-0/+4
| | | | llvm-svn: 127693
* Add -fcxx-exceptions to all tests that use C++ exceptions.Anders Carlsson2011-02-282-4/+4
| | | | llvm-svn: 126599
* Implement the C++0x deduced 'auto' feature.Richard Smith2011-02-201-0/+23
| | | | | | This fixes PR 8738, 9060 and 9132. llvm-svn: 126069
* Pass -fexceptions to all tests that use try/catch/throw.Anders Carlsson2011-02-192-4/+4
| | | | llvm-svn: 126037
* Implement access checking for the "delete" operator. Fixes PR9050,Douglas Gregor2011-02-011-5/+17
| | | | | | from Alex Miller! llvm-svn: 124663
* Implement substitution of a function parameter pack for its set ofDouglas Gregor2011-01-071-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | instantiated function parameters, enabling instantiation of arbitrary pack expansions involving function parameter packs. At this point, we can now correctly compile a simple, variadic print() example: #include <iostream> #include <string> void print() {} template<typename Head, typename ...Tail> void print(const Head &head, const Tail &...tail) { std::cout << head; print(tail...); } int main() { std::string hello = "Hello"; print(hello, ", world!", " ", 2011, '\n'); } llvm-svn: 123000
* Implement the sizeof...(pack) expression to compute the length of aDouglas Gregor2011-01-041-0/+26
| | | | | | | | | parameter pack. Note that we're missing proper libclang support for the new SizeOfPackExpr expression node. llvm-svn: 122813
* Properly diagnose invalid casts to function references. Patch byDouglas Gregor2010-11-081-4/+2
| | | | | | Faisal Vali, tweaked by me. Fixes PR8230. llvm-svn: 118400
* 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
* Test destructors in delete expressions and of temporaries for throwing.Sebastian Redl2010-09-101-1/+11
| | | | llvm-svn: 113664
* Address Doug's comments.Sebastian Redl2010-09-102-2/+4
| | | | llvm-svn: 113650
* Eli helped me understand how evaluation contexts work.Sebastian Redl2010-09-101-2/+13
| | | | llvm-svn: 113642
* Test CXXNoexceptExpr codegen and serialization.Sebastian Redl2010-09-102-0/+23
| | | | llvm-svn: 113630
OpenPOWER on IntegriCloud