summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/default-assignment-operator.cpp
Commit message (Collapse)AuthorAgeFilesLines
* When we emit an error during the implicit definition of a specialDouglas Gregor2010-05-121-1/+2
| | | | | | | | member function (default constructor, copy constructor, copy assignment operator, destructor), emit a note showing where that implicit definition was required. llvm-svn: 103619
* Speculatively revert r103497, "Do not mark the virtual members of anDaniel Dunbar2010-05-111-9/+4
| | | | | | implicitly-instantiated class as ...", which seems to have broken bootstrap. llvm-svn: 103515
* Do not mark the virtual members of an implicitly-instantiated class asDouglas Gregor2010-05-111-4/+9
| | | | | | | | referenced unless we see one of them defined (or the key function defined, if it as one) or if we need the vtable for something. Fixes PR7114. llvm-svn: 103497
* When implicit definition of the copy-assignment operator fails,Douglas Gregor2010-05-051-8/+6
| | | | | | | | | provide a note that shows where the copy-assignment operator was needed. We used to have this, but I broke it during refactoring. Finishes PR6999. llvm-svn: 103127
* When creating a call to a base subobject's operator= in anDouglas Gregor2010-05-041-0/+28
| | | | | | | | | implicitly-defined copy assignment operator, suppress the protected access check. This eliminates the remaining failure in the Boost.SmartPtr library (that was a product of the copy-assignment generation rewrite) and, presumably, the Boost.TR1 library as well. llvm-svn: 103010
* Complete reimplementation of the synthesis for implicitly-defined copyDouglas Gregor2010-05-011-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | assignment operators. Previously, Sema provided type-checking and template instantiation for copy assignment operators, then CodeGen would synthesize the actual body of the copy constructor. Unfortunately, the two were not in sync, and CodeGen might pick a copy-assignment operator that is different from what Sema chose, leading to strange failures, e.g., link-time failures when CodeGen called a copy-assignment operator that was not instantiation, run-time failures when copy-assignment operators were overloaded for const/non-const references and the wrong one was picked, and run-time failures when by-value copy-assignment operators did not have their arguments properly copy-initialized. This implementation synthesizes the implicitly-defined copy assignment operator bodies in Sema, so that the resulting ASTs encode exactly what CodeGen needs to do; there is no longer any special code in CodeGen to synthesize copy-assignment operators. The synthesis of the body is relatively simple, and we generate one of three different kinds of copy statements for each base or member: - For a class subobject, call the appropriate copy-assignment operator, after overload resolution has determined what that is. - For an array of scalar types or an array of class types that have trivial copy assignment operators, construct a call to __builtin_memcpy. - For an array of class types with non-trivial copy assignment operators, synthesize a (possibly nested!) for loop whose inner statement calls the copy constructor. - For a scalar type, use built-in assignment. This patch fixes at least a few tests cases in Boost.Spirit that were failing because CodeGen picked the wrong copy-assignment operator (leading to link-time failures), and I suspect a number of undiagnosed problems will also go away with this change. Some of the diagnostics we had previously have gotten worse with this change, since we're going through generic code for our type-checking. I will improve this in a subsequent patch. llvm-svn: 102853
* Change the 'declared at' diagnostic to say 'declared here'.Anders Carlsson2010-04-231-3/+3
| | | | llvm-svn: 102163
* Warn about non-aggregate classes with no user-declared constructorsDouglas Gregor2010-04-151-2/+4
| | | | | | | that have reference or const scalar members, since those members can never be initializer or modified. Fixes <rdar://problem/7804350>. llvm-svn: 101316
* When pretty-printing tag types, only print the tag if we're in C (andJohn McCall2010-03-101-3/+3
| | | | | | | | | | 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
* 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
* Pass the current SourceLocation to getAssignOperatorMethod, fixing a crash ↵Anders Carlsson2009-12-091-3/+2
| | | | | | when the assign operator method needs to be instantiated. Doug, please review the updated default-assignment-operator.cpp change. llvm-svn: 90935
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-10/+6
| | | | llvm-svn: 81346
* Use getDeclName in DefineImplicitOverloadedAssign as well.Anders Carlsson2009-07-091-0/+16
| | | | llvm-svn: 75152
* Test case for my last patch.Fariborz Jahanian2009-06-251-0/+74
llvm-svn: 74216
OpenPOWER on IntegriCloud