summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Removing a spurious comment, no functionality changes.Aaron Ballman2012-07-191-5/+0
| | | | llvm-svn: 160522
* For varargs, diagnose passing ObjC objects by value like other non-POD types.Jordan Rose2012-07-192-41/+56
| | | | | | | | | | | | | | While we still want to consider this a hard error (non-POD variadic args are normally a DefaultError warning), delaying the diagnostic allows us to give better error messages, which also match the usual non-POD errors more closely. In addition, this change improves the diagnostic messages for format string argument type mismatches by passing down the type of the callee, so we can say "variadic method" or "variadic function" appropriately. <rdar://problem/11825593> llvm-svn: 160517
* Don't crash checking a format string if one of the arguments is invalid.Jordan Rose2012-07-191-7/+20
| | | | | | | | | Previously, we would ask for the SourceLocation of an argument even if it were NULL (i.e. if Sema resulted in an ExprError trying to build it). <rdar://problem/11890818> llvm-svn: 160515
* Relaxed enumeration constant naming rules for scoped enumerators so they no ↵Aaron Ballman2012-07-191-6/+12
| | | | | | longer emit a diagnostic when the enumeration's name matches that of the class. Fixes PR13128. llvm-svn: 160490
* Fix OverloadCandidateSet::clear to not leak PartialDiagnostics, found by SamuelRichard Smith2012-07-181-1/+4
| | | | | | | | Panzer. I've not been able to trigger a failure caused by this, so no test yet. Also included is a small change from Paul Robinson to only consider the FailureKind if the overload candidate did actually fail. llvm-svn: 160470
* PR13381, part 2: when determining if a defaulted special member function shouldRichard Smith2012-07-181-9/+18
| | | | | | | | be defined as deleted, take cv-qualifiers on class members into account when looking up the copy or move constructor or assignment operator which will be used for them. llvm-svn: 160418
* PR13381: consider cv-qualifiers on a class member's type when determining whichRichard Smith2012-07-182-16/+26
| | | | | | | constructor will be used for moving that object, in the computation of its exception specification. llvm-svn: 160417
* PR13386: When matching up parameters between a function template declarationRichard Smith2012-07-182-31/+39
| | | | | | | | | | | and a function template instantiation, if there's a parameter pack in the declaration and one at the same place in the instantiation, don't assume that the pack wasn't expanded -- it may have expanded to nothing. Instead, go ahead and check whether the parameter pack was expandable. We can do this as a side-effect of the work we'd need to do anyway, to find how many parameters were produced. llvm-svn: 160416
* When performing the deduced/actual argument type check for C++Douglas Gregor2012-07-181-0/+10
| | | | | | | | [temp.deduct.call]p4 under Objective-C++ ARC, make sure to adjust the qualifiers to introduce the implicit strong lifetime when needed. Fixes <rdar://problem/11825671>. llvm-svn: 160412
* Remove unnecessary spacing around Objective-C object literal codeDouglas Gregor2012-07-171-9/+3
| | | | | | completions. Fixes <rdar://problem/11889572>. llvm-svn: 160407
* Handle the case where the base type is not dependent, but the derived one is.Rafael Espindola2012-07-171-2/+0
| | | | | | Fixes pr13353.cpp. llvm-svn: 160393
* Issue warning when assigning out-of-range integer values to enums.Fariborz Jahanian2012-07-172-1/+53
| | | | | | | Due to performance cost, this is an opt-in option placed under -Wassign-enum. // rdar://11824807 llvm-svn: 160382
* -Wobjc-literal-compare: don't warn when comparing against nil.Jordan Rose2012-07-171-2/+16
| | | | | | | | | | | | | | Checks against nil often appear as guards in macros, and comparing Objective-C literals to nil has well-defined behavior (if tautological). On OS X, 'nil' has not been typed as 'id' since 10.6 (possibly earlier), so the warning was already not firing, but other runtimes continue to use ((id)0) or some variant. This change accepts comparisons to any null pointer; to keep it simple, it looks through all casts (not just casts to 'id'). PR13276 llvm-svn: 160379
* Add -Wobjc-string-compare under -Wobjc-literal-compare.Jordan Rose2012-07-171-9/+22
| | | | | | | | | Suggested by Ted, since string literal comparison is at least slightly more sensible than comparison of runtime literals. (Ambiguous language on developer.apple.com implies that strings are guaranteed to be uniqued within a translation unit and possibly across a linked binary.) llvm-svn: 160378
* Now that -Wobjc-literal-compare is a warning, put the fixit on a note.Jordan Rose2012-07-171-100/+66
| | | | | | | | Recovering as if the user had actually called -isEqual: is a bit too far from the semantics of the program as written, /even though/ it's probably what they intended. llvm-svn: 160377
* Merge visibility from previous decls before looking at visibility pragma. ThisRafael Espindola2012-07-171-4/+4
| | | | | | | is a bit fuzzy, but matches gcc behavior and existing code bases seem to depend on it. llvm-svn: 160364
* Record visibility pragmas when we see a tag declaration. We might use itRafael Espindola2012-07-171-0/+4
| | | | | | to build a type before seeing the definition. llvm-svn: 160339
* Uninitialized variables: two little changes:Richard Smith2012-07-171-0/+1
| | | | | | | * Treat compound assignment as a use, at Jordy's request. * Always add compound assignments into the CFG, so we can correctly diagnose the use in 'return x += 1;' llvm-svn: 160334
* Simplify float comparison checks by using early return.David Blaikie2012-07-161-24/+16
| | | | | | Found while investigating PR13330 llvm-svn: 160318
* Fix rejects-valid: explicit specialization of redeclared deleted function ↵David Blaikie2012-07-161-1/+1
| | | | | | | | template. Review by Richard Smith. llvm-svn: 160306
* Add correct parenthesis range to CXXConstructExprs insideDaniel Jasper2012-07-161-0/+3
| | | | | | CXXFunctionalCastExprs. llvm-svn: 160252
* PR13365: Fix code which was trying to treat an array of DeducedTemplateArgumentRichard Smith2012-07-164-73/+66
| | | | | | | | as an array of its base class TemplateArgument. Switch the const TemplateArgument* parameters of InstantiatingTemplate's constructors to ArrayRef<TemplateArgument> to prevent this from happening again in the future. llvm-svn: 160245
* Without this patch clang warns onRafael Espindola2012-07-151-6/+36
| | | | | | | | | | | | | | | | | | | | | struct __attribute__((visibility("hidden"))) zed { }; struct __attribute__((visibility("hidden"))) zed; Which is a bit silly and got a lot noisier now that we correctly handle visibility pragmas. This patch fixes that and also has some extra quality improvements: * We now produce an error instead of a warning for struct __attribute__((visibility("hidden"))) zed { }; struct __attribute__((visibility("default"))) zed; * The "after definition" warning now points to the new attribute that is ignored instead of pointing to the declaration. llvm-svn: 160227
* Make const the argument of getDefinition.Rafael Espindola2012-07-151-4/+4
| | | | llvm-svn: 160226
* Use llvm::APSInt::isSameValue to compare for the same value.Eric Christopher2012-07-151-1/+1
| | | | | | Finishes rdar://11875995 llvm-svn: 160225
* Apply visibility pragmas to class template declarations. This is needed becauseRafael Espindola2012-07-131-0/+2
| | | | | | we might use the declaration to build a type before seeing the definition. llvm-svn: 160176
* Provide a special-case diagnostic when two class member functions instantiateRichard Smith2012-07-131-11/+16
| | | | | | | to the same signature. Fix a bug in the type printer which would cause this diagnostic to print wonderful types like 'const const int *'. llvm-svn: 160161
* Fix a bug in my previous commit. The problem is not that we were not using theRafael Espindola2012-07-131-0/+3
| | | | | | | canonical decl for the template, but that we were not merging attributes for templates at all! llvm-svn: 160157
* Attaching comments to declarations during parsing: handle more Objective-C ↵Dmitri Gribenko2012-07-133-1/+3
| | | | | | declarations. llvm-svn: 160156
* Process #pragma visibility early in the parsing of class definitions. FixesRafael Espindola2012-07-121-4/+4
| | | | | | pr13338. llvm-svn: 160105
* Ignore visibility attributes after definitions. This matches newer (4.7) gcc'sRafael Espindola2012-07-121-0/+8
| | | | | | behavior and is the first step in fixing pr13338. llvm-svn: 160104
* Don't try to do RVO on block variables that refer to an enclosing local.Nico Weber2012-07-111-1/+1
| | | | | | | Fixes PR13314, clang crashing on blocks refering to an enclosing local when the enclosing function returns void. llvm-svn: 160089
* Stop instantiating a class if we hit a static_assert failure. Also, if theRichard Smith2012-07-113-17/+35
| | | | | | | static_assert fails when parsing the template, don't diagnose it again on every instantiation. llvm-svn: 160088
* Enable comment parsing and semantic analysis to emit diagnostics. A fewDmitri Gribenko2012-07-114-1/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | diagnostics implemented -- see testcases. I created a new TableGen file for comment diagnostics, DiagnosticCommentKinds.td, because comment diagnostics don't logically fit into AST diagnostics file. But I don't feel strongly about it. This also implements support for self-closing HTML tags in comment lexer and parser (for example, <br />). In order to issue precise diagnostics CommentSema needs to know the declaration the comment is attached to. There is no easy way to find a decl by comment, so we match comments and decls in lockstep: after parsing one declgroup we check if we have any new, not yet attached comments. If we do -- then we do the usual comment-finding process. It is interesting that this automatically handles trailing comments. We pick up not only comments that precede the declaration, but also comments that *follow* the declaration -- thanks to the lookahead in the lexer: after parsing the declgroup we've consumed the semicolon and looked ahead through comments. Added -Wdocumentation-html flag for semantic HTML errors to allow the user to disable only HTML warnings (but not HTML parse errors, which we emit as warnings in -Wdocumentation). llvm-svn: 160078
* Handle #pragma visibility in explicit specializations and enums.Rafael Espindola2012-07-111-6/+4
| | | | llvm-svn: 160057
* Don't process #pragma visibility during instantiation. The visibility of theRafael Espindola2012-07-111-1/+2
| | | | | | | instantiation depends on the template, its arguments and parameters, but not where it is instantiated. llvm-svn: 160034
OpenPOWER on IntegriCloud