summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
* AttributeList: tweak the conditional order to avoid two strcmpsAlp Toker2013-12-051-2/+2
| | | | llvm-svn: 196518
* Fix a tranche of comment, test and doc typosAlp Toker2013-12-055-7/+7
| | | | llvm-svn: 196510
* PR17983: Fix crasher bug in C++1y mode when performing a non-global arrayRichard Smith2013-12-052-3/+6
| | | | | | | delete on a class which has no array cookie and has no class-specific operator new. llvm-svn: 196488
* Implement DR482: namespace members can be redeclared with a qualified nameRichard Smith2013-12-052-28/+29
| | | | | | | | | | within their namespace, and such a redeclaration isn't required to be a definition any more. Update DR status page to say Clang 3.4 instead of SVN and add new Clang 3.5 category (but keep Clang 3.4 yellow for now). llvm-svn: 196481
* Correct hyphenations in comments and assert messagesAlp Toker2013-12-054-6/+6
| | | | | | | This patch tries to avoid unrelated changes other than fixing a few hyphen-related ambiguities in nearby lines. llvm-svn: 196466
* Per [dcl.meaning]p1, a name in an inline namespace can be redeclared using aRichard Smith2013-12-053-24/+24
| | | | | | | name from the enclosing namespace set if the name is specified as a qualified-id. llvm-svn: 196464
* Remove unused variable.Richard Trieu2013-12-051-1/+0
| | | | llvm-svn: 196459
* Fix non-MSVC build error in ASTContext::getAdjustedTypeReid Kleckner2013-12-051-2/+4
| | | | | | | | Use FunctionTypeUnwrapper like we do in AttributedType to try to keep some sugar. We can actually do one better here in the future by avoiding the AdjustedType node altogether when no sugar would be lost. llvm-svn: 196455
* Fix init-captures for generic lambdas.Faisal Vali2013-12-057-56/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For an init capture, process the initialization expression right away. For lambda init-captures such as the following: const int x = 10; auto L = [i = x+1](int a) { return [j = x+2, &k = x](char b) { }; }; keep in mind that each lambda init-capture has to have: - its initialization expression executed in the context of the enclosing/parent decl-context. - but the variable itself has to be 'injected' into the decl-context of its lambda's call-operator (which has not yet been created). Each init-expression is a full-expression that has to get Sema-analyzed (for capturing etc.) before its lambda's call-operator's decl-context, scope & scopeinfo are pushed on their respective stacks. Thus if any variable is odr-used in the init-capture it will correctly get captured in the enclosing lambda, if one exists. The init-variables above are created later once the lambdascope and call-operators decl-context is pushed onto its respective stack. Since the lambda init-capture's initializer expression occurs in the context of the enclosing function or lambda, therefore we can not wait till a lambda scope has been pushed on before deciding whether the variable needs to be captured. We also need to process all lvalue-to-rvalue conversions and discarded-value conversions, so that we can avoid capturing certain constant variables. For e.g., void test() { const int x = 10; auto L = [&z = x](char a) { <-- don't capture by the current lambda return [y = x](int i) { <-- don't capture by enclosing lambda return y; } }; If x was not const, the second use would require 'L' to capture, and that would be an error. Make sure TranformLambdaExpr is also aware of this. Patch approved by Richard (Thanks!!) http://llvm-reviews.chandlerc.com/D2092 llvm-svn: 196454
* Add an AdjustedType sugar node for adjusting calling conventionsReid Kleckner2013-12-052-12/+34
| | | | | | | | | | | | | | | | Summary: In general, this type node can be used to represent any type adjustment that occurs implicitly without losing type sugar. The immediate use of this is to adjust the calling conventions of member function pointer types without breaking template instantiation. Fixes PR17996. Reviewers: rsmith Differential Revision: http://llvm-reviews.chandlerc.com/D2332 llvm-svn: 196451
* Reject template-ids containing literal-operator-ids that have a dependentRichard Smith2013-12-052-2/+29
| | | | | | | | | nested-name-specifier, rather than crashing. (In fact, reject all literal-operator-ids that have a non-namespace nested-name-specifier). The grammar doesn't allow these in some cases, and in other cases does allow them but instantiation will always fail. llvm-svn: 196443
* Giving a Subjects list to DllExport, which allows the removal of some custom ↵Aaron Ballman2013-12-041-9/+1
| | | | | | semantic handling. The same cannot be done for DllImport, and so comments were left explaining why. llvm-svn: 196429
* Common functionality is already checked within SemaDeclAttr.cpp and so it ↵Aaron Ballman2013-12-041-65/+4
| | | | | | does not need to be re-checked for each target. llvm-svn: 196428
* Factor duplicated code for TransformTypeInObjectScopeReid Kleckner2013-12-041-49/+22
| | | | | | Fixes the relevant FIXME about copy-pasted code. llvm-svn: 196425
* Fix for PR18052 - Lambdas within NSDMI's and default arguments in Nested ↵Faisal Vali2013-12-041-1/+10
| | | | | | | | | | | | | | | | | | | | | | classes. Clang currently croaks on the following: struct X1 { struct X2 { int L = ([] (int i) { return i; })(2); }; }; asserting that the containing lexical context of the lambda is not Sema's cur context, when pushing the lambda's decl context on. This occurs because (prior to this patch) getContainingDC always returns the non-nested class for functions at class scope (even for inline member functions of nested classes (to account for delayed parsing of their bodies)). The patch addresses this by having getContainingDC always return the lexical DC for a lambda's call operator. Link to the bug: http://llvm.org/bugs/show_bug.cgi?id=18052 Link to Richard Smith's feedback on phabricator: http://llvm-reviews.chandlerc.com/D2331 Thanks! llvm-svn: 196423
* The MSP430Interrupt attribute does have a sema handler (it's in ↵Aaron Ballman2013-12-041-0/+2
| | | | | | TargetAttributesSema). Added a FIXME about the attribute being nameless when it really does have a valid name, and a comment explaining why we're using the name instead of the attribute kind. llvm-svn: 196420
* Getting rid of some hard-coded strings. No functional changes intended, ↵Aaron Ballman2013-12-041-5/+5
| | | | | | though some test cases needed to be updated for attribute names becoming quoted. llvm-svn: 196417
* This attribute somehow remained nameless in the attribute tablegen, until now.Aaron Ballman2013-12-041-2/+1
| | | | llvm-svn: 196415
* ObjectiveC - Introducing objc_bridge_related attribute Fariborz Jahanian2013-12-041-0/+21
| | | | | | | | which specifies couple of (optional) method selectors for bridging a CFobject to or from an ObjectiveC object. This is wip. // rdsr://15499111 llvm-svn: 196408
* [ms-cxxabi] Construct and destroy call arguments in the correct orderReid Kleckner2013-12-041-2/+3
| | | | | | | | | | | | | | | | | | | Summary: MSVC destroys arguments in the callee from left to right. Because C++ objects have to be destroyed in the reverse order of construction, Clang has to construct arguments from right to left and destroy arguments from left to right. This patch fixes the ordering by reversing the order of evaluation of all call arguments under the MS C++ ABI. Fixes PR18035. Reviewers: rsmith Differential Revision: http://llvm-reviews.chandlerc.com/D2275 llvm-svn: 196402
* Sema: Propagate the mangling number into instantiationsDavid Majnemer2013-12-041-0/+13
| | | | | | | | | | | | | | | | | | We would lose track of the mangling number assigned to the original declaration which would cause us to create manglings that didn't match the Itanium C++ specification. e.g. Two static fields with the same name inside of a function template would receive the same mangling with LLVM fixing up the second field so they wouldn't collide. This would create an incompatibility with other compilers following the Itanium ABI. I've confirmed that the new mangling is identical to the ones generated by icc and gcc. N.B. This was uncovered while working on Microsoft mangler. llvm-svn: 196368
* Fix crash if a dependent template-id was assumed to be a type but instantiatesRichard Smith2013-12-041-1/+2
| | | | | | to a variable template specialization. llvm-svn: 196337
* Fix crash if a variable template specialization is used in a ↵Richard Smith2013-12-041-3/+3
| | | | | | nested-name-specifier. llvm-svn: 196335
* Fix several crash-on-invalids when using template-ids that aren'tRichard Smith2013-12-042-7/+8
| | | | | | simple-template-ids (eg, 'operator+<int>') in weird places. llvm-svn: 196333
* [objc] Add a warning when a class that provides a designated initializer, ↵Argyrios Kyrtzidis2013-12-032-1/+31
| | | | | | | | does not override all of the designated initializers of its superclass. llvm-svn: 196319
* [objc] Emit warning when the implementation of a secondary initializer calls onArgyrios Kyrtzidis2013-12-034-5/+26
| | | | | | | | | | | super another initializer and when the implementation does not delegate to another initializer via a call on 'self'. A secondary initializer is an initializer method not marked as a designated initializer within a class that has at least one initializer marked as a designated initializer. llvm-svn: 196318
* [objc] Emit warnings when the implementation of a designated initializer ↵Argyrios Kyrtzidis2013-12-032-8/+27
| | | | | | | | calls on super an initializer that is not a designated one or any initializer on self. llvm-svn: 196317
* [objc] Emit a warning when the implementation of a designated initializer ↵Argyrios Kyrtzidis2013-12-034-0/+32
| | | | | | | | does not chain to an init method that is a designated initializer for the superclass. llvm-svn: 196316
* [objc] Introduce ObjCInterfaceDecl::getDesignatedInitializers() to get theArgyrios Kyrtzidis2013-12-031-2/+4
| | | | | | | | | | designated initializers of an interface. If the interface declaration does not have methods marked as designated initializers then the interface inherits the designated initializers of its super class. llvm-svn: 196315
* [objc] Introduce attribute 'objc_designated_initializer'.Argyrios Kyrtzidis2013-12-031-0/+25
| | | | | | It only applies to methods of init family in an interface declaration. llvm-svn: 196314
* Issue diagnostic when constructor or destructorFariborz Jahanian2013-12-031-4/+16
| | | | | | | return void expression. // rdar://15366494 pr17759. llvm-svn: 196296
* Refactored the work group-related attributes to use a template, which ↵Aaron Ballman2013-12-021-33/+10
| | | | | | reduces the amount of duplicate code in the handler. No functional change intended. llvm-svn: 196165
* Simplifying a test for duplicate vec_type_hint attributes. The assert and ↵Aaron Ballman2013-12-021-5/+1
| | | | | | attribute kind test were superfluous. No functional change intended. llvm-svn: 196162
* The CUDA device attribute doesn't need custom logic to check the number of ↵Aaron Ballman2013-12-021-14/+2
| | | | | | attribute arguments (the common attribute handler already does this). Switching to use the simple attribute handler. No functional change intended. llvm-svn: 196155
* Automate attribute language option checking by specifying the list of ↵Aaron Ballman2013-12-022-155/+64
| | | | | | options to test in tablegen. llvm-svn: 196138
* Factored attribute mutual exclusion code into a helper function; split the ↵Aaron Ballman2013-12-021-35/+37
| | | | | | cf_audited_transfer and cf_unknown_transfer attributes into separate helper methods for simplicity. No functional changes intended. llvm-svn: 196126
* Re-enabled support for the Subjects for the weak attribute. This changes the ↵Aaron Ballman2013-12-021-19/+2
| | | | | | diagnostic involved to be more accurate -- for C++ code, it will now report that weak applies to variables, functions or classes. Added additional test case for this. llvm-svn: 196120
* The __w64 attribute handler was more generically named, but only applied to ↵Aaron Ballman2013-12-021-8/+4
| | | | | | __w64 specifically. Renamed and removed some unused code. No functional change intended. llvm-svn: 196116
* The FieldDecl is already covered by the ValueDecl case, so it is being removed.Aaron Ballman2013-12-021-2/+0
| | | | llvm-svn: 196110
* Switching the ibaction attribute handler to the generalized handler. No ↵Aaron Ballman2013-12-021-6/+2
| | | | | | functional change intended. llvm-svn: 196107
* Replacing custom subject application logic with table-generated logic. ↵Aaron Ballman2013-12-021-53/+2
| | | | | | Affects: guarded_var, pt_guarded_var, guarded_by, pt_guarded_by, acquired_after and acquired_before. No functional change intended. llvm-svn: 196105
* Fix inconsistent diag nameAlp Toker2013-12-021-2/+2
| | | | llvm-svn: 196061
* Handle CC and NoReturn when instantiating members of class templates.Rafael Espindola2013-12-012-18/+26
| | | | | | | | Before we were considering them only when instantiating templates. This fixes pr18033. llvm-svn: 196050
* Refactored the tls_model attribute to use a custom subset subject. No ↵Aaron Ballman2013-11-291-6/+0
| | | | | | functional change intended. llvm-svn: 195964
* Using a custom subject to reenable the Subjects line for the ns_bridged ↵Aaron Ballman2013-11-291-6/+0
| | | | | | attribute. No functional change intended. llvm-svn: 195963
* Enables support for custom subject lists for attributes. As a testbed, uses ↵Aaron Ballman2013-11-291-10/+2
| | | | | | the custom subject for the ibaction attribute. llvm-svn: 195960
* Sema: Instantiation of variable definitions weren't local enoughDavid Majnemer2013-11-271-6/+4
| | | | | | | | | | | We wouldn't properly save and restore the pending local instantiations we had built up prior to instantiation of a variable definition. This would lead to us instantiating too much causing crashes and other general badness. This fixes PR14374. llvm-svn: 195887
* Converts the lockable attributes to use the simple attribute handler because ↵Aaron Ballman2013-11-271-33/+2
| | | | | | the semantic checking was already automated. llvm-svn: 195866
* Automated checking for C++ when determining what argument to send to the ↵Aaron Ballman2013-11-271-16/+0
| | | | | | diagnostic for attribute subjects. In turn, this allows the Subjects to be enabled for some more attributes and improves diagnostics. Updated a test case based on the improved diagnostic. llvm-svn: 195864
* Adding the Subjects entry back for the noreturn attributes. This caused some ↵Aaron Ballman2013-11-271-19/+1
| | | | | | test cases to be updated because the original diagnostic was about applying to methods as well as functions, but the semantic checking disallowed methods. llvm-svn: 195862
OpenPOWER on IntegriCloud