summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclCXX.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Store on the CXXRecordDecl whether the class has, or would have, a copyRichard Smith2012-11-281-141/+4
| | | | | | | constructor/assignment operator with a const-qualified parameter type. The prior method for determining this incorrectly used overload resolution. llvm-svn: 168775
* C++ core issue 1344, PR10618: promote "addition of default argument makes thisRichard Smith2012-11-281-9/+16
| | | | | | | | | | | | a special member" diagnostic from warning to error, and fix the cases where it produced diagnostics with incorrect wording. We don't support this as an extension, and we ban it even in C++98 mode. This breaks too much (for instance, the ABI-specified calling convention for a type can change if it acquires a copy constructor through the addition of a default argument). llvm-svn: 168769
* Simplify checking for whether we should implicitly declare special members andRichard Smith2012-11-271-1/+4
| | | | | | add some assertions. No functionality change. llvm-svn: 168725
* A step towards sorting out handling of triviality of special members in C++11.Richard Smith2012-11-161-4/+1
| | | | | | | | | | | | | | Separate out the notions of 'has a trivial special member' and 'has a non-trivial special member', and use them appropriately. These are not opposites of one another (there might be no special member, or in C++11 there might be a trivial one and a non-trivial one). The CXXRecordDecl predicates continue to produce incorrect results, but do so in fewer cases now, and they document the cases where they might be wrong. No functionality changes are intended here (they will come when the predicates start producing the right answers...). llvm-svn: 168119
* Teach the uninitialized field warning about anonymous structs and union members.Nick Lewycky2012-11-151-9/+23
| | | | | | Fixes PR14073! llvm-svn: 168031
* Remove another questionable use of hasTrivial*. The relevant thing for thisRichard Smith2012-11-141-93/+114
| | | | | | | test was whether the /selected/ operator= was trivial, not whether the class had any trivial (or any non-trivial) operator=s. llvm-svn: 167897
* Fix some wrong-code bugs in implicitly-defined assignment operators:Richard Smith2012-11-131-35/+43
| | | | | | | - In C++11, perform overload resolution over all assignment operators, rather than just looking for copy/move assignment operators. - Clean up after temporaries produced by operator= immediately, rather than accumulating them until the end of the function. llvm-svn: 167798
* Factor duplicated implicit memcpy call generation code out of copy/moveRichard Smith2012-11-121-200/+69
| | | | | | | | assignment generation. This incidentally avoids reusing the same Expr* across multiple statements in the same object; that was generating slightly broken ASTs, but I couldn't trigger any observable bad behavior, so no test. llvm-svn: 167779
* Rework my implementation of circular-reference finding to not useDouglas Gregor2012-11-101-7/+34
| | | | | | | CXXRecordDecl::forallBases, which does *not* do what I need. Fixes the failure introduced in r167651. llvm-svn: 167668
* Diagnostic circular inheritance involving dependent base classes. WeDouglas Gregor2012-11-101-4/+31
| | | | | | | would have diagnosed this at instantiation time anyway, if only we didn't hang on all of these test cases. Fixes <rdar://problem/12629723> llvm-svn: 167651
* Put the usage-directive inside the nearest namespace or TU decl. We don't wantNick Lewycky2012-11-041-3/+3
| | | | | | | | to have UsingDirectiveDecl inside anything other than those two. No user-visible functionality change. llvm-svn: 167376
* Rework implementation of DR1492: Apply the resolution to operator delete too,Richard Smith2012-10-201-1/+1
| | | | | | | | | | | | since it also has an implicit exception specification. Downgrade the error to an extwarn, since at least for operator delete, system headers like to declare it as 'noexcept' whereas the implicit definition does not have an explicit exception specification. Move the exception specification for user-declared 'operator delete' functions from the type-as-written into the type, to reflect reality and to allow us to detect whether there was an implicit exception spec or not. llvm-svn: 166372
* Handle diamond inheritance in -Woverloaded-virtual.David Blaikie2012-10-191-13/+29
| | | | llvm-svn: 166254
* Fix Objective-C implicit property synthesis for C++ classes so we use valid Eli Friedman2012-10-181-30/+8
| | | | | | | | | | | source locations in places where it is necessary for diagnostics. By itself, this causes assertions, so while I'm here, also fix property synthesis for properties of C++ class type so we use so we properly set up a scope and mark variable declarations. <rdar://problem/12514189>. llvm-svn: 166219
* Fix -Woverloaded-virtual when the using statement refers to a base ↵David Blaikie2012-10-171-1/+6
| | | | | | | | | | | | | | | declaration of a virtual function. GCC and Clang both do not warn on: struct a { virtual void func(); }; struct b: a { virtual void func(); void func(int); }; struct c: b { void func(int); using b::func; }; but if the "using" was using a::func GCC would still remain silent where Clang would warn. This change makes Clang consistent with GCC's existing behavior. llvm-svn: 166154
* Fix typo correction of one qualified name to another.David Blaikie2012-10-121-1/+2
| | | | | | | | | | | | | | When suggesting "foo::bar" as a correction for "fob::bar" we mistakenly replaced only "bar" with "foo::bar" producing "fob::foo::bar" which was broken. This corrects that replacement in as many places as I could find & provides test cases for all those cases I could find a test case for. There are a couple that don't seem to be reachable (one looks entirely dead, the other just doesn't seem to ever get called with a namespace to namespace change). Review by Richard Smith ( http://llvm-reviews.chandlerc.com/D57 ). llvm-svn: 165817
* Fix stack overflow when trying to create an implicit movingArgyrios Kyrtzidis2012-10-101-1/+1
| | | | | | | | constructor with invalid code. rdar://12240916 llvm-svn: 165623
* Workaround for libstdc++4.6 <atomic> bug: make comment more explicit about ↵Richard Smith2012-10-051-2/+7
| | | | | | what's going on, per Sean Silva's suggestion. llvm-svn: 165286
* Egriegious hack to support libstdc++4.6's broken <atomic> header, which definesRichard Smith2012-10-041-24/+41
| | | | | | | | a non-inline namespace, then reopens it as inline to try to add its symbols to the surrounding namespace. In this one special case, permit the namespace to be reopened as inline, and patch up the name lookup tables to match. llvm-svn: 165263
* Add FP_CONTRACT support for clang.Lang Hames2012-10-021-1/+1
| | | | | | | | Clang will now honor the FP_CONTRACT pragma and emit LLVM fmuladd intrinsics for expressions of the form A * B + C (when they occur in a single statement). llvm-svn: 164989
* Fix for r163013 regression and further __interface enhancement.John McCall2012-09-251-4/+59
| | | | | | Patch by Andy Gibbs! llvm-svn: 164590
* Don't produce diagnostics for missing ctor-initializers during templateRichard Smith2012-09-251-1/+5
| | | | | | instantiations if we encountered errors parsing some of the initializers. llvm-svn: 164578
* Make warnings about uninitialized fields include the field name.Hans Wennborg2012-09-211-1/+1
| | | | | | | | | | | This makes the wording more informative, and consistent with the other warnings about uninitialized variables. Also, me and David who reviewed this couldn't figure out why we would need to do a lookup to get the name of the variable; so just print the name directly. llvm-svn: 164366
* Doxygen-ify a comment.Craig Topper2012-09-211-4/+4
| | | | llvm-svn: 164360
* PR13890: Warn on abstract final classes.David Blaikie2012-09-211-0/+5
| | | | llvm-svn: 164359
* Per C++11 [class.friend]p3, the 'friend' keyword must appear first in aRichard Smith2012-09-201-10/+14
| | | | | | non-function friend declaration. Patch by Josh Magee! llvm-svn: 164273
* Warn about self references in in-class initializers.Hans Wennborg2012-09-181-94/+101
| | | | | | | | | | | | | | This makes Clang warn about self references in in-class initializers, for example: struct S { int a = a + 42; }; This basically just moves UninitializedFieldVisitor up a bit in SemaDeclCXX.cpp, and adds a call to it from ActOnCXXInClassMemberInitializer. llvm-svn: 164131
* Don't write uninitialized values even if nobody ever asks for it.Axel Naumann2012-09-171-1/+1
| | | | llvm-svn: 164033
* When diagnosing multiple mem-initializers in a delegating ctor, point to the ↵Richard Smith2012-09-141-4/+3
| | | | | | delegating initializer, not to the first initializer. For good measure, also highlight the other initializer. llvm-svn: 163919
* As we do with base and member initializers in a dependent class, delayDouglas Gregor2012-09-141-1/+5
| | | | | | | | | type checking for non-static data member initializers in a dependent class, because our ASTs lose too much information to when type-checking an initializer. Fixes <rdar://problem/11974632>, although the result is still rather unsatisfactory. llvm-svn: 163871
* Remove redundant semicolons which are null statements.Dmitri Gribenko2012-09-101-1/+1
| | | | llvm-svn: 163546
* Don't try to check override control for invalid member functions. Fixes a ↵Richard Smith2012-09-061-0/+3
| | | | | | crash in a corner case. Patch by Olivier Goffart! llvm-svn: 163337
* Changed the remaining dead asserts to llvm_unreachable.Joao Matos2012-09-011-7/+5
| | | | llvm-svn: 163039
* Normalize line endings of r163013 (part 2).Joao Matos2012-08-311-30/+30
| | | | llvm-svn: 163032
* Improved MSVC __interface support by adding first class support for it, ↵Joao Matos2012-08-311-14/+30
| | | | | | instead of aliasing to "struct" which had some incorrect behaviour. Patch by David Robins. llvm-svn: 163013
* Change the representation of builtin functions in the ASTEli Friedman2012-08-311-8/+8
| | | | | | | | | (__builtin_* etc.) so that it isn't possible to take their address. Specifically, introduce a new type to represent a reference to a builtin function, and a new cast kind to convert it to a function pointer in the operand of a call. Fixes PR13195. llvm-svn: 162962
* Push ArrayRef through the Expr hierarchy.Benjamin Kramer2012-08-241-5/+3
| | | | | | No functionality change. llvm-svn: 162552
* Now that ASTMultiPtr is nothing more than a array reference, make it a ↵Benjamin Kramer2012-08-231-16/+13
| | | | | | | | MutableArrayRef. This required changing all get() calls to data() and using the simpler constructors. llvm-svn: 162501
* Remove ASTOwningVector, it doesn't own anything and provides no value over ↵Benjamin Kramer2012-08-231-5/+5
| | | | | | SmallVector. llvm-svn: 162492
* Rip out remnants of move semantic emulation and smart pointers in Sema.Benjamin Kramer2012-08-231-20/+20
| | | | | | | These were nops for quite a while and only lead to confusion. ASTMultiPtr now behaves like a proper dumb array reference. llvm-svn: 162475
* Fix undefined behavior: member function calls where 'this' is a null pointer.Richard Smith2012-08-231-16/+18
| | | | llvm-svn: 162430
* Better wording for reference self-initialization warning.Hans Wennborg2012-08-201-1/+4
| | | | llvm-svn: 162198
* Store SourceManager pointer on PrintingPolicy in the case where we're dumping,Richard Smith2012-08-161-1/+1
| | | | | | | | | and remove ASTContext reference (which was frequently bound to a dereferenced null pointer) from the recursive lump of printPretty functions. In so doing, fix (at least) one case where we intended to use the 'dump' mode, but that failed because a null ASTContext reference had been passed in. llvm-svn: 162011
* Make __is_convertible_to handle abstract types correctly. PR13591.Eli Friedman2012-08-141-0/+1
| | | | llvm-svn: 161828
* Check access to friend declarations. There's a number of differentJohn McCall2012-08-101-2/+4
| | | | | | | | | | | | | | things going on here that were problematic: - We were missing the actual access check, or rather, it was suppressed on account of being a redeclaration lookup. - The access check would naturally happen during delay, which isn't appropriate in this case. - We weren't actually emitting dependent diagnostics associated with class templates, which was unfortunate. - Access was being propagated incorrectly for friend method declarations that couldn't be matched at parse-time. llvm-svn: 161652
* -Wunused-private-fields: Don't try to check unresolved initializer expressionsRichard Smith2012-08-071-43/+24
| | | | | | | | for side-effects. Instead, check for side-effects after performing initialization. Doing so also removes some strange corner cases and differences between in-class initialization and constructor initialization. llvm-svn: 161449
* PR13499: Don't try to check whether 'override' has been validly applied untilRichard Smith2012-08-061-35/+39
| | | | | | | we know whether the function is virtual. But check it as soon as we do know; in some cases we don't need to wait for an instantiation. llvm-svn: 161316
* PR13527: don't assert if a function is explicitly defaulted when it's alreadyRichard Smith2012-08-061-1/+2
| | | | | | been defined. llvm-svn: 161315
* Fix crash if a literal operator template's template parameter pack is not a ↵Richard Smith2012-08-031-1/+1
| | | | | | non-type template parameter pack. Patch by Andy Gibbs! llvm-svn: 161260
* Attaching comments to declarations: handle using-declaration.Dmitri Gribenko2012-08-021-0/+1
| | | | llvm-svn: 161211
OpenPOWER on IntegriCloud