summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExprMember.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Move parsing of identifiers in MS-style inline assembly intoJohn McCall2013-05-031-17/+34
| | | | | | | | | | | | | | | | | | | | | the actual parser and support arbitrary id-expressions. We're actually basically set up to do arbitrary expressions here if we wanted to. Assembly operands permit things like A::x to be written regardless of language mode, which forces us to embellish the evaluation context logic somewhat. The logic here under template instantiation is incorrect; we need to preserve the fact that an expression was unevaluated. Of course, template instantiation in general is fishy here because we have no way of delaying semantic analysis in the MC parser. It's all just fishy. I've also fixed the serialization of MS asm statements. This commit depends on an LLVM commit. llvm-svn: 180976
* Basic support for Microsoft property declarations andJohn McCall2013-04-161-1/+19
| | | | | | | | references thereto. Patch by Tong Shen! llvm-svn: 179585
* Objective-C: Provide fixit hints when warningFariborz Jahanian2013-04-021-1/+1
| | | | | | | | about 'isa' ivar being explicitely accessed when base is a user class object reference. // rdar://13503456 llvm-svn: 178562
* Objective-C: Produce precise diagnostic whenFariborz Jahanian2013-03-281-13/+0
| | | | | | | | 'isa' ivar is accessed provided it is the first ivar. Fixit hint will follow in another patch. This is continuation of // rdar://13503456 llvm-svn: 178313
* Objective-C: Provide fixit suggestions when class objectFariborz Jahanian2013-03-281-0/+1
| | | | | | | | is accessed via accessing 'isa' ivar to use object_getClass/object_setClass apis. // rdar://13503456 llvm-svn: 178282
* Objective-C: Issue more precise warning when userFariborz Jahanian2013-03-271-4/+1
| | | | | | | is accessing 'isa' as an object pointer. // rdar://13503456. FixIt to follow in another patch. llvm-svn: 178179
* Fix assertion failure when a field is given an address space.Matt Arsenault2013-02-261-8/+8
| | | | llvm-svn: 176122
* objective-C: When implementing custom accessor method forFariborz Jahanian2013-02-141-1/+2
| | | | | | | | a property, the -Wdirect-ivar-access should not warn when accessing the property's synthesized instance variable. // rdar://13142820 llvm-svn: 175195
* s/CPlusPlus0x/CPlusPlus11/gRichard Smith2013-01-021-1/+1
| | | | llvm-svn: 171367
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-3/+3
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* Fix regression in r168477. Use canonical decl when looking for base classRichard Smith2012-11-221-1/+1
| | | | | | specified as a qualified name. llvm-svn: 168479
* Fix CXXRecordDecl::forallBases to not look through bases which are dependentRichard Smith2012-11-221-36/+26
| | | | | | | | and defined within the current instantiation, but which are not part of the current instantiation. Previously, it would look at bases which could be specialized separately from the current template. llvm-svn: 168477
* From Vassil Vassilev: enable Sema to deal with multiple ExternalSemaSources.Axel Naumann2012-10-181-1/+1
| | | | llvm-svn: 166208
* 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
* Change (!ptr != 0) to (!ptr) to make the code more readable.Richard Trieu2012-10-121-1/+1
| | | | | | No functional change. llvm-svn: 165811
* -Warc-repeated-use-of-weak: check ivars and variables as well.Jordan Rose2012-09-281-3/+18
| | | | | | | | | | Like properties, loading from a weak ivar twice in the same function can give you inconsistent results if the object is deallocated between the two loads. It is safer to assign to a strong local variable and use that. Second half of <rdar://problem/12280249>. llvm-svn: 164855
* Rip out remnants of move semantic emulation and smart pointers in Sema.Benjamin Kramer2012-08-231-3/+3
| | | | | | | These were nops for quite a while and only lead to confusion. ASTMultiPtr now behaves like a proper dumb array reference. llvm-svn: 162475
* Random string removal.Eric Christopher2012-08-161-1/+1
| | | | llvm-svn: 162063
* objc: Include all types when issuing warning underFariborz Jahanian2012-08-081-1/+1
| | | | | | -Wdirect-ivar-access. llvm-svn: 161500
* objc-arc: Make -Wdirect-ivar-access accessible to allFariborz Jahanian2012-08-071-5/+5
| | | | | | | memory models, except when arc is accessing a weak ivar (which is an error). // rdar://6505197 llvm-svn: 161458
* objective-c: Exclude -Wdirect-ivar-access for arc.Fariborz Jahanian2012-08-071-2/+11
| | | | | | | Allow direct ivar access in init and dealloc methods in mrr. // rdar://650197 llvm-svn: 161426
* objective-c: Implement gcc's -Wdirect-ivar-access option.Fariborz Jahanian2012-08-061-1/+3
| | | | | | // rdar://6505197 llvm-svn: 161362
* Consolidate ObjC lookupPrivateMethod methods from Sema and DeclObjC.Anna Zaks2012-07-271-3/+0
| | | | | | | | | | | | | Also, fix a subtle bug, which occurred due to lookupPrivateMethod defined in DeclObjC.h not looking up the method inside parent's categories. Note, the code assumes that Class's parent object has the same methods as what's in the Root class of a the hierarchy, which is a heuristic that might not hold for hierarchies which do not descend from NSObject. Would be great to fix this in the future. llvm-svn: 160885
* objective-c: If an ivar is (1) the first ivar in a root class and (2) named ↵Fariborz Jahanian2012-06-211-1/+14
| | | | | | | | `isa`, then it should get the same warnings that id->isa gets. // rdar://11702488 llvm-svn: 158938
* Documentation cleanup:James Dennett2012-06-151-3/+3
| | | | | | | | | * Removed \param comments for parameters that no longer exist; * Fixed a "\para" typo to "\param"; * Escaped @, # and \ symbols as needed in Doxygen comments; * Added use of \brief to output short summaries. llvm-svn: 158498
* Introduce -Wunused-private-field. If enabled, this warning detectsDaniel Jasper2012-06-061-0/+2
| | | | | | | unused private fields of classes that are fully defined in the current translation unit. llvm-svn: 158054
* Anonymous union members within a struct are now properly handled as an ↵Aaron Ballman2012-06-011-1/+1
| | | | | | unevaluated field in C++11 mode. This fixes PR12866. llvm-svn: 157784
* Move Sema::RequireCompleteType() and Sema::RequireCompleteExprType()Douglas Gregor2012-05-041-5/+4
| | | | | | | | | | | off PartialDiagnostic. PartialDiagnostic is rather heavyweight for something that is in the critical path and is rarely used. So, switch over to an abstract-class-based callback mechanism that delays most of the work until a diagnostic is actually produced. Good for ~11k code size reduction in the compiler and 1% speedup in -fsyntax-only on the code in <rdar://problem/11004361>. llvm-svn: 156176
* Let's use the correct bool this time.Kaelyn Uhrain2012-05-011-1/+1
| | | | llvm-svn: 155871
* A couple of very small tweaks suggested by Doug in reply to r155580 and r155163.Kaelyn Uhrain2012-05-011-1/+1
| | | | llvm-svn: 155870
* Add an error message with fixit hint for changing '.' to '->'.Kaelyn Uhrain2012-04-251-3/+32
| | | | | | | | | This is mainly for attempting to recover in cases where a class provides a custom operator-> and a '.' was accidentally used instead of '->' when accessing a member of the object returned by the current object's operator->. llvm-svn: 155580
* Also highlight the member name.Matt Beaumont-Gay2012-04-211-2/+2
| | | | llvm-svn: 155274
* Fix a QoI bug reported by a user.Matt Beaumont-Gay2012-04-211-2/+2
| | | | | | | | | | | Set the source location for the "member reference base type ... is not a structure or union" diag to point at the operator rather than the member name. If we're giving this diagnostic because of a typo'd '.' in place of a ';' at the end of a line, the caret previously pointed at the identifier on the following line, which isn't as helpful as it could be. Pointing the caret at the '.' makes it more obvious what the problem is. llvm-svn: 155267
* Implement C++11 [expr.prim.general]p3, which permits the use of 'this'Douglas Gregor2012-04-161-12/+5
| | | | | | | | | | | | | | | | | | | | | | | in the declaration of a non-static member function after the (optional) cv-qualifier-seq, which in practice means in the exception specification and late-specified return type. The new scheme here used to manage 'this' outside of a member function scope is more general than the Scope-based mechanism previously used for non-static data member initializers and late-parsesd attributes, because it can also handle the cv-qualifiers on the member function. Note, however, that a separate pass is required for static member functions to determine whether 'this' was used, because we might not know that we have a static function until after declaration matching. Finally, this introduces name mangling for 'this' and for the implicit 'this', which is intended to match GCC's mangling. Independent verification for the new mangling test case would be appreciated. Fixes PR10036 and PR12450. llvm-svn: 154799
* Improve diagnostics for invalid use of non-static members / this:Richard Smith2012-04-051-19/+27
| | | | | | | | | | | | * s/nonstatic/non-static/ in the diagnostics, since the latter form outvoted the former by 28-2 in our diagnostics. * Fix the "use of member in static member function" diagnostic to correctly detect this situation inside a block or lambda. * Produce a more specific "invalid use of non-static member" diagnostic for the case where a nested class member refers to a member of a lexically-surrounding class. llvm-svn: 154073
* Fix crash on invalid code. I've tried to produce a reduced test case, but ↵Ted Kremenek2012-03-171-1/+10
| | | | | | when I do the specific crash is hidden. Fixes <rdar://problem/11063594>. llvm-svn: 152968
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-111-8/+8
| | | | | | | | | | (Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
* objective-c lldb support: don't perform ivar access control check Fariborz Jahanian2012-03-071-9/+10
| | | | | | when debugging. // rdar://10997647 llvm-svn: 152187
* Fix r151443 to only apply C++11's exception for non-static data member accessRichard Smith2012-02-251-5/+14
| | | | | | | in cases where we would otherwise disallow the access, and add a -Wc++98-compat diagnostic for this C++11 feature. llvm-svn: 151444
* PR11956: C++11's special exception for accessing non-static data members fromRichard Smith2012-02-251-15/+15
| | | | | | unevaluated operands applies within member functions, too. llvm-svn: 151443
* Bugfix: bogus warning -- "invalid use of non-static data member",DeLesley Hutchins2012-02-251-1/+2
| | | | | | | when a class is forward declared, and the reference to the data member in question does not occur within a method body. llvm-svn: 151413
* Fixed instantiation of DependentScopeDeclRefExpr.Abramo Bagnara2012-02-061-2/+2
| | | | llvm-svn: 149868
* Split Sema::MarkDeclarationReferenced into multiple functions; the ↵Eli Friedman2012-02-021-16/+17
| | | | | | additional entry points are needed to implement C++11 odr-use marking correctly. No functional change in this patch; I'll actually make the change which fixes the odr-use marking in a followup patch. llvm-svn: 149586
* Make the callback object to Sema::CorrectTypo mandatory.Kaelyn Uhrain2012-01-311-2/+2
| | | | llvm-svn: 149451
* Added source location for the template keyword in AST template-id expressions.Abramo Bagnara2012-01-271-16/+26
| | | | llvm-svn: 149127
* Remove PotentiallyPotentiallyEvaluated, and replace it with a much simpler ↵Eli Friedman2012-01-201-35/+11
| | | | | | and less error-prone way of handling the relevant cases. Towards marking of whether a declaration is used more accurately. llvm-svn: 148522
* objc: deprecate direct usage of 'isa' of objc objectsFariborz Jahanian2012-01-181-2/+4
| | | | | | | in favor of usage of api's intended for. // rdar://8290002 llvm-svn: 148404
* Make PotentiallyPotentiallyEvaluated contexts work correctly when ↵Eli Friedman2012-01-181-15/+44
| | | | | | referencing a class field from outside an instance method. llvm-svn: 148376
* Remove unreachable code in Clang. (replace with llvm_unreachable where ↵David Blaikie2012-01-171-1/+0
| | | | | | appropriate or when GCC requires it) llvm-svn: 148292
* Convert SemaExprMember.cpp to pass a callback object to CorrectTypo,Kaelyn Uhrain2012-01-131-12/+23
| | | | | | | | | improving the typo correction results in certain situations. This is also the first typo correction callback conversion to affect an existing unit test. :) llvm-svn: 148140
OpenPOWER on IntegriCloud