summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/deleted-function.cpp
Commit message (Collapse)AuthorAgeFilesLines
* PR22673 again: diagnose use of the used decl, not the found decl. This is alsoRichard Smith2015-02-241-0/+6
| | | | | | | wrong (DiagnoseUseOfDecl should take both), but it's more consistent with what we do in other places. llvm-svn: 230384
* PR22673: Don't forget to check a constructor for deletedness when we use it toRichard Smith2015-02-241-2/+2
| | | | | | implicitly construct a temporary in a reference binding. llvm-svn: 230381
* Add test that we reject invocations of deleted constructors. One of theseRichard Smith2015-02-241-0/+22
| | | | | | constructs is not rejected by should be; that's PR22673. llvm-svn: 230370
* Implemented delayed processing of 'unavailable' checking, just like with ↵Ted Kremenek2013-12-181-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | 'deprecated'. Fixes <rdar://problem/15584219> and <rdar://problem/12241361>. This change looks large, but all it does is reuse and consolidate the delayed diagnostic logic for deprecation warnings with unavailability warnings. By doing so, it showed various inconsistencies between the diagnostics, which were close, but not consistent. It also revealed some missing "note:"'s in the deprecated diagnostics that were showing up in the unavailable diagnostics, etc. This change also changes the wording of the core deprecation diagnostics. Instead of saying "function has been explicitly marked deprecated" we now saw "'X' has been been explicitly marked deprecated". It turns out providing a bit more context is useful, and often we got the actual term wrong or it was not very precise (e.g., "function" instead of "destructor"). By just saying the name of the thing that is deprecated/deleted/unavailable we define this issue away. This diagnostic can likely be further wordsmithed to be shorter. llvm-svn: 197627
* Fix rejects-valid: explicit specialization of redeclared deleted function ↵David Blaikie2012-07-161-3/+2
| | | | | | | | template. Review by Richard Smith. llvm-svn: 160306
* Avoid redundant error when redefining a function as deleted.David Blaikie2012-06-291-0/+3
| | | | | | Reviewed by Doug Gregor. llvm-svn: 159442
* PR12937: Explicitly deleting an explicit template specialization.David Blaikie2012-06-251-0/+8
| | | | | | | | | | | | | | | This works around a quirk in the way that explicit template specializations are handled in Clang. We generate an implicit declaration from the original template which the explicit specialization is considered to redeclare. This trips up the explicit delete logic. This change only works around that strange representation. At some point it'd be nice to remove those extra declarations to make the AST more accurately reflect the C++ semantics. Review by Doug Gregor. llvm-svn: 159167
* Diagnose uses of deleted destructors and inaccessible defaulted destructors.Richard Smith2012-02-181-1/+23
| | | | | | | | | | We had two separate issues here: firstly, varions functions were assuming that they did not need to perform semantic checks on trivial destructors (this is not true in C++11, where a trivial destructor can nonetheless be private or deleted), and a bunch of DiagnoseUseOfDecl calls were missing for uses of destructors. llvm-svn: 150866
* Update all tests other than Driver/std.cpp to use -std=c++11 rather thanRichard Smith2011-10-131-1/+1
| | | | | | -std=c++0x. Patch by Ahmed Charles! llvm-svn: 141900
* Modify some deleted function methods to better reflect reality:Alexis Hunt2011-05-061-3/+2
| | | | | | | | | | | | | | | | | | | | - New isDefined() function checks for deletedness - isThisDeclarationADefinition checks for deletedness - New doesThisDeclarationHaveABody() does what isThisDeclarationADefinition() used to do - The IsDeleted bit is not propagated across redeclarations - isDeleted() now checks the canoncial declaration - New isDeletedAsWritten() does what it says on the tin. - isUserProvided() now correct (thanks Richard!) This fixes the bug that we weren't catching void foo() = delete; void foo() {} as being a redefinition. llvm-svn: 131013
* When pretty-printing tag types, only print the tag if we're in C (andJohn McCall2010-03-101-1/+1
| | | | | | | | | | 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
* Switch default-initialization of variables of class type (or array thereof) ↵Douglas Gregor2009-12-201-2/+2
| | | | | | over to InitializationSequence. I could swear that this fixes a PR somewhere, but I couldn't figure out which one llvm-svn: 91796
* Initialization improvements: addition of string initialization and a fewEli Friedman2009-12-191-2/+2
| | | | | | | | small bug fixes in SemaInit, switch over SemaDecl to use it more often, and change a bunch of diagnostics which are different with the new initialization code. llvm-svn: 91767
* 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
* Issue good diagnostics when initialization failes due toFariborz Jahanian2009-09-151-1/+1
| | | | | | ambiguity in type conversion function selection. llvm-svn: 81898
* Add deleted functions and rvalue references to C++ status.Sebastian Redl2009-04-121-0/+2
| | | | llvm-svn: 68903
* Parse deleted member functions. Parsing member declarations goes through a ↵Sebastian Redl2009-04-121-0/+12
| | | | | | | | | different code path that I forgot previously. Implement the rvalue reference overload dance for returning local objects. Returning a local object first tries to find a move constructor now. The error message when no move constructor is defined (or is not applicable) and the copy constructor is deleted is quite ugly, though. llvm-svn: 68902
* Parse deleted function definitions and hook them up to Doug's machinery.Sebastian Redl2009-03-241-0/+22
llvm-svn: 67653
OpenPOWER on IntegriCloud