summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
* For global record types, the self reference checker was called twice, resultingRichard Trieu2012-08-061-1/+4
| | | | | | | in duplicate -Wuninitialized warnings. Change so that only the check in TryConstructorInitialization() will be used and a single warning be emitted. llvm-svn: 161345
* [ms-inline asm] Pass Tokens to Sema and store them in the AST. No functionalChad Rosier2012-08-062-2/+5
| | | | | | change intended. No test case as there's no real way to test at this time. llvm-svn: 161342
* 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-062-1/+3
| | | | | | been defined. llvm-svn: 161315
* Simplify code, no functionality change.Benjamin Kramer2012-08-041-2/+1
| | | | llvm-svn: 161303
* 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
* Fix line endings.Michael Han2012-08-031-41/+41
| | | | llvm-svn: 161245
* Attaching comments to declarations: handle using-declaration.Dmitri Gribenko2012-08-021-0/+1
| | | | llvm-svn: 161211
* objective-c arc: Patch to suggest bridge casting of CFFariborz Jahanian2012-08-021-2/+31
| | | | | | | objects used as dictionary subscript objects. // rdar://11913153 llvm-svn: 161187
* Fix an assertion failure instantiating a constexpr function from within a ↵Eli Friedman2012-08-014-14/+14
| | | | | | -dealloc method. PR13401. llvm-svn: 161135
* Explicitly defaulted constructors cannot be used for default initialization.Aaron Ballman2012-07-311-1/+1
| | | | llvm-svn: 161088
* Comment parsing: add support for \tparam command on all levels.Dmitri Gribenko2012-07-312-1/+6
| | | | | | | | | | The only caveat is renumbering CXCommentKind enum for aesthetic reasons -- this breaks libclang binary compatibility, but should not be a problem since API is so new. This also fixes PR13372 as a side-effect. llvm-svn: 161087
* When testing whether we can perform copy or move initialization, beDouglas Gregor2012-07-311-2/+2
| | | | | | sure to supply an initialization location. Fixes <rdar://problem/11951661>. llvm-svn: 161084
* Fix some minor typosSylvestre Ledru2012-07-311-1/+1
| | | | llvm-svn: 161036
* Introduce new queries on ObjCRuntime for how to interpret subscriptsJohn McCall2012-07-312-62/+88
| | | | | | | | on object pointers and whether pointer arithmetic on object pointers is supported. Make ObjFW interpret subscripts as pseudo-objects. Based on a patch by Jonathan Schleifer. llvm-svn: 161028
* Attributes preceding a function declaration are first applied to the returnRafael Espindola2012-07-311-0/+2
| | | | | | | | | | type and then propagated to the function. This was failing for destructors, constructors and constructors templates since they don't have a return type. Fix that by directly calling processTypeAttrs on the dummy type we use as the return type in these cases. llvm-svn: 161020
* Explain why ACC_bottom should never occur in diagnosing ARC casts.Jordan Rose2012-07-311-3/+3
| | | | | | | This is just a clarification on Fariborz's original patch, per e-mail discussion. No functionality change. llvm-svn: 161016
* PR13479: If we see the definition of an out-of-line destructor in C++11, beRichard Smith2012-07-301-8/+26
| | | | | | | | sure to update the exception specification on the declaration as well as the definition. If we're building in -fno-exceptions mode, nothing else will trigger it to be updated. llvm-svn: 161008
* Extend the ',' versus ';' diagnostic for -Wvexing-parse to cover the ↵Richard Smith2012-07-301-31/+32
| | | | | | with-arguments case as well as the no-arguments case. llvm-svn: 160999
* Improvements to vexing-parse warnings. Make the no-parameters case moreRichard Smith2012-07-303-56/+107
| | | | | | | | | | | | | accurate by asking the parser whether there was an ambiguity rather than trying to reverse-engineer it from the DeclSpec. Make the with-parameters case have better diagnostics by using semantic information to drive the warning, improving the diagnostics and adding a fixit. Patch by Nikola Smiljanic. Some minor changes by me to suppress diagnostics for declarations of the form 'T (*x)(...)', which seem to have a very high false positive rate, and to reduce indentation in 'warnAboutAmbiguousFunction'. llvm-svn: 160998
* objective-c arc: ARC IRGen correctly assumes resultFariborz Jahanian2012-07-301-1/+18
| | | | | | | | | | type of generated call to super dealloc is 'void' and asserts if user's dealloc is not of 'void type. This rule must be enforced in clang front-end (with a fixit) if this is not the case, instead of asserting in CodeGen. // rdar://11987838 llvm-svn: 160993
* Do not warn on correct use of the '%n' format specifier.Matt Beaumont-Gay2012-07-301-9/+0
| | | | | | | | While '%n' can be used for evil in an attacker-controlled format string, there isn't any acute danger in using it in a literal format string with an argument of the appropriate type. llvm-svn: 160984
* Make -Wformat check the argument type for %n.Hans Wennborg2012-07-301-2/+0
| | | | | | | This makes Clang check that the corresponding argument for "%n" in a format string is a pointer to int. llvm-svn: 160966
* Use the location of the copy assignment when diagnosing classes that are ↵Benjamin Kramer2012-07-301-4/+3
| | | | | | nontrivial because of it. llvm-svn: 160962
* PR13433: In Microsoft mode, don't require function calls within decltypeRichard Smith2012-07-281-0/+5
| | | | | | | | | expressions to have complete return types (or accessible destructors). If the return type is required to be complete for some other reason (for instance, if it is needed by overload resolution), then it will still be required to be complete. This is apparently required in order to parse a MSVC11 header. llvm-svn: 160924
* assert on ACC_bottom when checking for invalidFariborz Jahanian2012-07-281-2/+4
| | | | | | CF to ARC conversions. llvm-svn: 160923
* more objc-arc: With ACC_bottom, we just provideFariborz Jahanian2012-07-281-2/+2
| | | | | | | __bride fixit, as it doesn't matter which cast to use. // rdar://11923822 llvm-svn: 160906
* objc-arc: change per Jordy's comments.Fariborz Jahanian2012-07-271-13/+14
| | | | | | // rdar://11923822 llvm-svn: 160902
* objective-c arc: When function calls with known CFCreate naming conventionFariborz Jahanian2012-07-271-8/+18
| | | | | | | | are cast to retainable types, only suggest CFBridgingRelease/ CFBridgingRetain and not the __bridge casts. // rdar://11923822 llvm-svn: 160900
* revert r160839 for now.Fariborz Jahanian2012-07-271-12/+27
| | | | llvm-svn: 160895
* Consolidate ObjC lookupPrivateMethod methods from Sema and DeclObjC.Anna Zaks2012-07-273-71/+6
| | | | | | | | | | | | | 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
* Fix PR13394: Erasing from a vector changes the end of the vector, so make ↵Benjamin Kramer2012-07-271-3/+3
| | | | | | sure we always have the right end. llvm-svn: 160855
* clang/lib: [CMake] Update tblgen'd dependencies.NAKAMURA Takumi2012-07-271-0/+3
| | | | llvm-svn: 160851
* clang/lib: [CMake] Reformat, alphabetize lists.NAKAMURA Takumi2012-07-271-5/+5
| | | | llvm-svn: 160850
* Final piece of core issue 1330: delay computing the exception specification ofRichard Smith2012-07-277-267/+281
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a defaulted special member function until the exception specification is needed (using the same criteria used for the delayed instantiation of exception specifications for function temploids). EST_Delayed is now EST_Unevaluated (using 1330's terminology), and, like EST_Uninstantiated, carries a pointer to the FunctionDecl which will be used to resolve the exception specification. This is enabled for all C++ modes: it's a little faster in the case where the exception specification isn't used, allows our C++11-in-C++98 extensions to work, and is still correct for C++98, since in that mode the computation of the exception specification can't fail. The diagnostics here aren't great (in particular, we should include implicit evaluation of exception specifications for defaulted special members in the template instantiation backtraces), but they're not much worse than before. Our approach to the problem of cycles between in-class initializers and the exception specification for a defaulted default constructor is modified a little by this change -- we now reject any odr-use of a defaulted default constructor if that constructor uses an in-class initializer and the use is in an in-class initialzer which is declared lexically earlier. This is a closer approximation to the current draft solution in core issue 1351, but isn't an exact match (but the current draft wording isn't reasonable, so that's to be expected). llvm-svn: 160847
* objc-arc: When objects with known CF semantics are assigned toFariborz Jahanian2012-07-261-27/+12
| | | | | | | | retainable types in arc, only suggest CFBridgingRelease/ CFBridgingRetain and not the confusing __bridge casts. // rdar://11923822 llvm-svn: 160839
* Disable the warning for missing prototypes for OpenCL kernels. Includes ↵Tanya Lattner2012-07-261-0/+4
| | | | | | testcase. llvm-svn: 160766
* PR12057: Allow variadic template pack expansions to cross lambda boundaries.Richard Smith2012-07-254-49/+99
| | | | | | | | | | Rather than adding a ContainsUnexpandedParameterPack bit to essentially every AST node, we tunnel the bit directly up to the surrounding lambda expression when we reach a context where an unexpanded pack can not normally appear. Thus any statement or declaration within a lambda can now potentially contain an unexpanded parameter pack. llvm-svn: 160705
* Pedantic -pedantic correction. Duplicate cv-qualifiers are permitted in C++11Richard Smith2012-07-241-3/+5
| | | | | | unless they appear in a decl-specifier-seq. llvm-svn: 160688
* Tweak warning text for returning incomplete type from extern "C" functions.Hans Wennborg2012-07-241-4/+5
| | | | | | | | | | A warning was added in r150128 for returning non-C compatible user-defined types from functions with C linkage. This makes the text more clear for the case when the type isn't decidedly non-C compatible, but incomplete. llvm-svn: 160681
* Emit debug info for dynamic initializers. Permit __attribute__((nodebug)) onNick Lewycky2012-07-241-3/+9
| | | | | | | variables that have static storage duration, it removes debug info on the emitted initializer function but not all debug info about this variable. llvm-svn: 160659
* Fix whitespace, whoops missed a spot!Nick Lewycky2012-07-241-1/+1
| | | | llvm-svn: 160658
* Fix whitespace, tabs to spaces. No functionality change.Nick Lewycky2012-07-241-6/+6
| | | | llvm-svn: 160657
* Change APInt to APSInt in one instance. Also change a call to operator==() toRichard Trieu2012-07-231-1/+1
| | | | | | APSInt::isSameValue() when comparing different sized APSInt's. llvm-svn: 160641
* Refactor handler functions for thread safety attributes.Michael Han2012-07-231-100/+205
| | | | | | | | Make handler functions for thread safety attributes consistent with other attributes handler functions by removing the bool parameter from some of the thread safety attributes handler functions and extracting common checks out of different handler functions. llvm-svn: 160635
* Fix a typo (the the => the)Sylvestre Ledru2012-07-234-5/+5
| | | | llvm-svn: 160622
* When we have an Objective-C object with non-trivial lifetime in aDouglas Gregor2012-07-232-2/+2
| | | | | | | | structor class under ARC, that struct/class does not have a trivial move constructor or move assignment operator. Fixes the rest of <rdar://problem/11738725>. llvm-svn: 160615
* PR12917: Remove incorrect assumption that lambda mangling information cannotRichard Smith2012-07-224-66/+75
| | | | | | | | | | change once it's been assigned. It can change in two ways: 1) In a template instantiation, the context declaration should be the instantiated declaration, not the declaration in the template. 2) If a lambda appears in the pattern of a variadic pack expansion, the mangling number will depend on the pack length. llvm-svn: 160614
* No longer assuming the number of prototype arguments is always less than the ↵Aaron Ballman2012-07-201-1/+1
| | | | | | number of formal parameters for a variadic function call. llvm-svn: 160570
* Reset the layout of an ObjC class if we see an ivar in a categoryEric Christopher2012-07-191-0/+17
| | | | | | | | or implementation since we've now got a different layout. Fixes rdar://11842763 llvm-svn: 160526
OpenPOWER on IntegriCloud