summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaObjCXX
Commit message (Collapse)AuthorAgeFilesLines
...
* Improve diagnostic for using non-class/namespace/scoped enum in a nested ↵David Blaikie2014-02-091-3/+3
| | | | | | | | | | | | | | | name specifier. Rather than simply saying "X is not a class or namespace", clarify what X is by providing the aka type in the case where X is a type, or pointing to the named declaration if there's an unambiguous one to refer to. In the ambiguous case, the ambiguities are already enumerated (though could be clarified by describing what kind of entities they are) Included a few FIXMEs in tests where some further improvements could be made. llvm-svn: 201038
* A new conversion warning for when an Objective-C object literal is implicitlyRichard Trieu2014-01-281-0/+74
| | | | | | | | | cast into a boolean true value. This warning will catch code like: if (@0) {} if (@"foo") {} llvm-svn: 200356
* Remove the -cxx-abi command-line flag.Hans Wennborg2014-01-141-1/+1
| | | | | | | | | | | | | | | This makes the C++ ABI depend entirely on the target: MS ABI for -win32 triples, Itanium otherwise. It's no longer possible to do weird combinations. To be able to run a test with a specific ABI without constraining it to a specific triple, new substitutions are added to lit: %itanium_abi_triple and %ms_abi_triple can be used to get the current target triple adjusted to the desired ABI. For example, if the test suite is running with the i686-pc-win32 target, %itanium_abi_triple will expand to i686-pc-mingw32. Differential Revision: http://llvm-reviews.chandlerc.com/D2545 llvm-svn: 199250
* [ms-cxxabi] Elide dtor access checks for pass-by-val objects in calleesHans Wennborg2014-01-131-2/+3
| | | | | | | | | | | | | | | The ABI requires the destructor to be invoked in the callee, but the standard does not require access checks here so we avoid doing direct access checks on the destructor. If we end up needing to define an implicit destructor, we don't skip access checks for the base class, etc. Those checks are effectively part of generating the destructor definition, and aren't affected by which TU the check is performed in. Differential Revision: http://llvm-reviews.chandlerc.com/D2409 llvm-svn: 199120
* Objective-C ARC++: Prefer references to __strong/__weak over ↵Douglas Gregor2014-01-021-0/+16
| | | | | | | | __unsafe_unretained. Fixes <rdar://problem/15713945>. llvm-svn: 198343
* Implemented delayed processing of 'unavailable' checking, just like with ↵Ted Kremenek2013-12-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | '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
* Allow Objective-C pointer conversions following an explicit user conversion.Douglas Gregor2013-12-181-0/+19
| | | | | | Finishes the work started in r194224, and fixes <rdar://problem/15494681>. llvm-svn: 197609
* ObjectiveC. Further improvements of useFariborz Jahanian2013-12-161-8/+4
| | | | | | | | | | of objc_bridge_related attribute; eliminate unnecessary diagnostics which is issued elsewhere, fixit now produces a valid AST tree per convention. This results in some simplification in handling of this attribute as well. // rdar://15499111 llvm-svn: 197436
* Objective-C: Improve on various diagnostics related toFariborz Jahanian2013-12-091-6/+6
| | | | | | use of objc_bridge_related attribute. // rdar://15499111 llvm-svn: 196828
* ObjectiveC. Continuing implementation of objc_bridge_relatedFariborz Jahanian2013-12-071-0/+31
| | | | | | | | | attribute in sema and issuing a variety of diagnostics lazily for misuse of this attribute (and what to do) when converting from CF types to ObjectiveC types (and vice versa). // rdar://15499111 llvm-svn: 196629
* Test to ensure no old-style-cast warning is emitted for objc-arc __bridge castsAlp Toker2013-12-031-0/+11
| | | | llvm-svn: 196204
* ObjectiveC migrator. Improve on definition, useFariborz Jahanian2013-11-222-2/+2
| | | | | | | | and testing of objc_bridgmutable attribute per Aaron Ballman's comments. // rdar://15498044 llvm-svn: 195396
* ObjectiveC. Allow toll free bridge cast warnings outsideFariborz Jahanian2013-11-212-0/+267
| | | | | | | ARC and in objectiveC/ObjectiveC++ MRR mode as well. // rdar://15454846 llvm-svn: 195288
* Fix new check for missing semicolon after struct definition to deal with theRichard Smith2013-11-201-4/+4
| | | | | | | case where the type in the following declaration is specified as a template-id, and refactor for clarity. llvm-svn: 195280
* Objective-C++ ARC: Improve the conversion to a const __unsafe_unretained ↵Douglas Gregor2013-11-081-0/+10
| | | | | | | | | | | | | reference. Under ARC++, a reference to a const Objective-C pointer is implicitly treated as __unsafe_unretained, and can be initialized with (e.g.) a __strong lvalue. Make sure this behavior does not break template argument deduction and (related) that partial ordering still prefers a 'T* const&' template over a 'T const&' template when this case kicks in. Fixes <rdar://problem/14467941>. llvm-svn: 194239
* Re-instate contextual conversion to Objective-C pointers in message sends.Douglas Gregor2013-11-071-0/+33
| | | | | | | | | When performing an Objective-C message send to a value of class type, perform a contextual conversion to an Objective-C pointer type. We've had this for a long time, but it recently regressed. Fixes <rdar://problem/15234703>. llvm-svn: 194224
* ObjectiveC++: support for passing C++11 style initialized temporaries to Fariborz Jahanian2013-10-161-0/+31
| | | | | | | objc++ properties using property-dot syntax. // rdar://14654207 llvm-svn: 192819
* Replace -fobjc-default-synthesize-properties with ↵Rafael Espindola2013-09-271-1/+1
| | | | | | | | | disable-objc-default-synthesize-properties. We want the modern behavior most of the time, so inverting the option simplifies the driver and the tests. llvm-svn: 191551
* Don't produce duplicate notes if we have deduction failure notes when resolvingRichard Smith2013-08-141-2/+1
| | | | | | the address of an overloaded function template. llvm-svn: 188334
* FIXME fix: improving diagnostics for template arguments deduction of class ↵Larisse Voufo2013-07-191-2/+4
| | | | | | | | templates and explicit specializations This patch essentially removes all the FIXMEs following calls to DeduceTemplateArguments() that want to keep track of deduction failure info. llvm-svn: 186730
* Revert "Use function overloading instead of template specialization for ↵Larisse Voufo2013-07-191-4/+2
| | | | | | | | diagnosis of bad template argument deductions." This reverts commit a730f548325756d050d4caaa28fcbffdae8dfe95. llvm-svn: 186729
* Use function overloading instead of template specialization for diagnosis of ↵Larisse Voufo2013-07-191-2/+4
| | | | | | bad template argument deductions. llvm-svn: 186727
* Fix recovery for missing * in objc property.Eli Friedman2013-07-091-0/+8
| | | | | | <rdar://problem/14354144> llvm-svn: 185897
* Remove referece type onproperty of abstractFariborz Jahanian2013-07-051-1/+1
| | | | | | class type. // rdar://14261999 llvm-svn: 185734
* Objective-C: diagnose when synthesizing an ivar ofFariborz Jahanian2013-07-051-0/+4
| | | | | | abstract class type. // rdar://14261999 llvm-svn: 185710
* [Sema] Call CheckParmForFunctionDef on ObjC method parametersReid Kleckner2013-06-241-0/+14
| | | | | | | CheckParmForFunctionDef performs standard checks for type completeness and other things like a destructor check for the MSVC++ ABI. llvm-svn: 184740
* Add missing test.Eli Friedman2013-06-211-0/+11
| | | | llvm-svn: 184515
* Introduce a new mangling for protocol-qualified ObjC types in C++. This allowsEli Friedman2013-06-182-35/+7
| | | | | | | | | | | | to provide proper overloading, and also prevents mangling conflicts with template arguments of protocol-qualified type. This is a non-backward-compatible mangling change, but per discussion with John, the benefits outweigh this cost. Fixes <rdar://problem/14074822>. llvm-svn: 184250
* Fix some confusing diagnostic wording. s/implicit default/implicit/ if we'reRichard Smith2013-06-131-1/+1
| | | | | | not actually talking about a default constructor. llvm-svn: 183885
* Objective-C++ (and c++) Sema: Patch fixes a sema crash when gnu’s ?: ↵Fariborz Jahanian2013-05-171-0/+23
| | | | | | | | | | | extension is used for Objective-C++’s dictionary subscripting. This is done by filtering out all placeholder types before check on lowering of the common expression is done. // rdar://1374918. Reviewed by John McCall. llvm-svn: 182120
* improve of note message and minor refactoring of my lastFariborz Jahanian2013-05-151-1/+1
| | | | | | patch (r181847). llvm-svn: 181896
* Objective-C [diagnostics] [QOI], when method is notFariborz Jahanian2013-05-141-1/+1
| | | | | | | | found for a receiver, note where receiver class is declaraed (this is most common when receiver is a forward class). // rdar://3258331 llvm-svn: 181847
* Grab-bag of bit-field fixes:John McCall2013-05-061-3/+16
| | | | | | | | | | | | | | - 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
* Extended VerifyDiagnosticConsumer to also verify source file for diagnostic.Andy Gibbs2013-04-171-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | VerifyDiagnosticConsumer previously would not check that the diagnostic and its matching directive referenced the same source file. Common practice was to create directives that referenced other files but only by line number, and this led to problems such as when the file containing the directive didn't have enough lines to match the location of the diagnostic in the other file, leading to bizarre file formatting and other oddities. This patch causes VerifyDiagnosticConsumer to match source files as well as line numbers. Therefore, a new syntax is made available for directives, for example: // expected-error@file:line {{diagnostic message}} This extends the @line feature where "file" is the file where the diagnostic is generated. The @line syntax is still available and uses the current file for the diagnostic. "file" can be specified either as a relative or absolute path - although the latter has less usefulness, I think! The #include search paths will be used to locate the file and if it is not found an error will be generated. The new check is not optional: if the directive is in a different file to the diagnostic, the file must be specified. Therefore, a number of test-cases have been updated with regard to this. This closes out PR15613. llvm-svn: 179677
* When checking for illegal expressions in a default-argumentJohn McCall2013-04-091-0/+18
| | | | | | | | expression, look through pseudo-object expressions. rdar://13602832 llvm-svn: 179080
* <rdar://problem/13540921> Fix a crasher when an Objective-C for-in loop gets ↵Douglas Gregor2013-04-081-0/+6
| | | | | | a non-variable iteration declaration. llvm-svn: 179053
* <rdar://problem/13540921> Cope with instantiations of the C++11 range-based ↵Douglas Gregor2013-04-081-0/+8
| | | | | | for loop that end up being Objective-C fast enumeration loops. llvm-svn: 179037
* <rdar://problem/13540921> Cope with deduced 'auto' in a C++11 for-range loop ↵Douglas Gregor2013-04-081-0/+2
| | | | | | that is actually an Objective-C fast enumeration loop. llvm-svn: 179035
* Fold together the two implementations of 6.7.3p2 in SemaType. Fix two bugs, ↵Richard Smith2013-03-281-0/+3
| | | | | | | | | each of which was only present in one version: * Give the right diagnostic for 'restrict' applied to a non-pointer, non-reference type. * Don't reject 'restrict' applied indirectly to an Objective-C object pointer type (eg, through template instantiation). llvm-svn: 178200
* Objective-C: Issue more precise warning when userFariborz Jahanian2013-03-271-2/+2
| | | | | | | is accessing 'isa' as an object pointer. // rdar://13503456. FixIt to follow in another patch. llvm-svn: 178179
* Add a clarifying note when a return statement is rejected becauseJohn McCall2013-03-191-0/+216
| | | | | | | | we expect a related result type. rdar://12493140 llvm-svn: 177378
* Sema: Preserve attributes on parameters in instantiated function templates.Jordan Rose2013-03-081-0/+32
| | | | | | | | | | | | | | | | | | This was causing correctness issues for ARC and the static analyzer when a function template has "consumed" Objective-C object parameters (i.e. parameters that will be released by the function before returning). The fix is threefold: (1) Actually copy over the attributes from old ParmVarDecls to new ones. (2) Have Sema::BuildFunctionType only work for building FunctionProtoTypes, which it was doing anyway. This allows us to pass an ExtProtoInfo instead of a plain ExtInfo and several flags. (3) Drop param attributes as part of StripImplicitInstantiation, which is used when an implicit instantiation is followed by an explicit one. <rdar://problem/12685622> llvm-svn: 176728
* Improve LLDB's implicit cast-to-id to work with C++11 auto and any ↵Douglas Gregor2013-03-071-4/+30
| | | | | | Objective-C object type <rdar://problem/13338107>. llvm-svn: 176665
* Perform non-overload placeholder conversions on the operandsJohn McCall2013-03-041-0/+35
| | | | | | | | to a subscript operator. rdar://13332183 llvm-svn: 176428
* objective-C arc: Diagnostic can not say to use bridgeFariborz Jahanian2013-02-221-0/+9
| | | | | | | casts with c++ named casts. Change notes to say use bridge with c-style cast instead. // rdar://12788838 llvm-svn: 175850
* One can override an Objective-C ARC ownership qualifier that came fromDouglas Gregor2013-01-171-0/+8
| | | | | | | a template parameter; make that also include one that came from 'auto'. Fixes <rdar://problem/12078752>. llvm-svn: 172770
* In Objective-C ARC, completely ignore ownership qualifiers on theDouglas Gregor2013-01-171-0/+9
| | | | | | | | return type of a function by canonicalizing them away. They are useless anyway, and conflict with our rules for template argument deduction and __strong. Fixes <rdar://problem/12367446>. llvm-svn: 172768
* put back diagnostics when flexible members are capturedFariborz Jahanian2013-01-091-2/+3
| | | | | | in lambdas. llvm-svn: 171921
* Remove lambda from my last patch.Fariborz Jahanian2013-01-081-4/+2
| | | | llvm-svn: 171915
* objectiveC blocks: It is impractical to capture Fariborz Jahanian2013-01-081-0/+9
| | | | | | | | struct variables with flexiable array members in blocks (and lambdas). Issue error instead of crashing in IRGen. // rdar://12655829 llvm-svn: 171912
OpenPOWER on IntegriCloud