summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
* In VarDecl nodes, store the thread storage class specifier as written.Enea Zaffanella2013-05-042-4/+2
| | | | llvm-svn: 181113
* Implement most of N3638 (return type deduction for normal functions).Richard Smith2013-05-047-34/+250
| | | | | | | Missing (somewhat ironically) is support for the new deduction rules in lambda functions, plus PCH support for return type patching. llvm-svn: 181108
* Don't build a call expression referring to a function which we're not allowedRichard Smith2013-05-043-18/+37
| | | | | | | | | to use. This makes very little difference right now (other than suppressing follow-on errors in some cases), but will matter more once we support deduced return types (we don't want expressions with undeduced return types in the AST). llvm-svn: 181107
* Say 'decltype(auto)' not 'auto' as appropriate in mismatched-deduction ↵Richard Smith2013-05-041-0/+1
| | | | | | diagnostic. llvm-svn: 181103
* Implement template support for CapturedStmtWei Pan2013-05-042-7/+21
| | | | | | | | - Sema tests added and CodeGen tests are pending Differential Revision: http://llvm-reviews.chandlerc.com/D728 llvm-svn: 181101
* Simplify slightly.Richard Smith2013-05-041-4/+4
| | | | llvm-svn: 181092
* Separate out and special-case the diagnostic for 'auto' in aRichard Smith2013-05-041-6/+15
| | | | | | | conversion-type-id, in preparation for this becoming valid in c++1y mode. No functionality change; small diagnostic improvement. llvm-svn: 181089
* ArrayRef'ize MultiLevelTemplateArgumentList::ArgList. Patch by Faisal Vali!Richard Smith2013-05-032-20/+14
| | | | llvm-svn: 181077
* Revert r177218.Argyrios Kyrtzidis2013-05-031-7/+0
| | | | | | Per discussion in cfe-commits, asserting may be a better way than introducing a special test flag. llvm-svn: 181073
* Test commitWei Pan2013-05-031-1/+1
| | | | llvm-svn: 181057
* PR15906: The body of a lambda is not an evaluated subexpression; don't visit ↵Richard Smith2013-05-031-1/+1
| | | | | | it when visiting such subexpressions. llvm-svn: 181046
* Move CapturedStmt parameters to CapturedDeclBen Langmuir2013-05-032-7/+18
| | | | | | | | | | | Move the creation of CapturedStmt parameters out of CodeGen and into Sema, making it easier to customize the outlined function. The ImplicitParamDecls are stored in the CapturedDecl using an ASTContext-allocated array. Differential Revision: http://llvm-reviews.chandlerc.com/D722 llvm-svn: 181043
* Keep track of an @implementation's super class name location, if one was ↵Argyrios Kyrtzidis2013-05-031-1/+1
| | | | | | provided. llvm-svn: 181039
* ArrayRef'ize InitializationSequence constructor and ↵Dmitri Gribenko2013-05-039-176/+132
| | | | | | | | InitializationSequence::Diagnose() Patch by Robert Wilhelm. llvm-svn: 181022
* Add const qualifier to Sema::getTypeName's parameter `II`Dmitri Gribenko2013-05-031-1/+1
| | | | | | Patch by Ismail Pazarbasi. llvm-svn: 181011
* Correctly emit certain implicit references to 'self' even withinJohn McCall2013-05-031-1/+1
| | | | | | | | | | | | | | | | | | a lambda. Bug #1 is that CGF's CurFuncDecl was "stuck" at lambda invocation functions. Fix that by generally improving getNonClosureContext to look through lambdas and captured statements but only report code contexts, which is generally what's wanted. Audit uses of CurFuncDecl and getNonClosureAncestor for correctness. Bug #2 is that lambdas weren't specially mapping 'self' when inside an ObjC method. Fix that by removing the requirement for that and using the normal EmitDeclRefLValue path in LoadObjCSelf. rdar://13800041 llvm-svn: 181000
* Move parsing of identifiers in MS-style inline assembly intoJohn McCall2013-05-038-313/+123
| | | | | | | | | | | | | | | | | | | | | 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
* Use attribute argument information to determine when to parse attribute ↵Douglas Gregor2013-05-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | arguments as expressions. This change partly addresses a heinous problem we have with the parsing of attribute arguments that are a lone identifier. Previously, we would end up parsing the 'align' attribute of this as an expression "(Align)": template<unsigned Size, unsigned Align> class my_aligned_storage { __attribute__((align((Align)))) char storage[Size]; }; while this would parse as a "parameter name" 'Align': template<unsigned Size, unsigned Align> class my_aligned_storage { __attribute__((align(Align))) char storage[Size]; }; The code that handles the alignment attribute would completely ignore the parameter name, so the while the first of these would do what's expected, the second would silently be equivalent to template<unsigned Size, unsigned Align> class my_aligned_storage { __attribute__((align)) char storage[Size]; }; i.e., use the maximal alignment rather than the specified alignment. Address this by sniffing the "Args" provided in the TableGen description of attributes. If the first argument is "obviously" something that should be treated as an expression (rather than an identifier to be matched later), parse it as an expression. Fixes <rdar://problem/13700933>. llvm-svn: 180973
* Revert r180970; it's causing breakage.Douglas Gregor2013-05-021-2/+2
| | | | llvm-svn: 180972
* Use attribute argument information to determine when to parse attribute ↵Douglas Gregor2013-05-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | arguments as expressions. This change partly addresses a heinous problem we have with the parsing of attribute arguments that are a lone identifier. Previously, we would end up parsing the 'align' attribute of this as an expression "(Align)": template<unsigned Size, unsigned Align> class my_aligned_storage { __attribute__((align((Align)))) char storage[Size]; }; while this would parse as a "parameter name" 'Align': template<unsigned Size, unsigned Align> class my_aligned_storage { __attribute__((align(Align))) char storage[Size]; }; The code that handles the alignment attribute would completely ignore the parameter name, so the while the first of these would do what's expected, the second would silently be equivalent to template<unsigned Size, unsigned Align> class my_aligned_storage { __attribute__((align)) char storage[Size]; }; i.e., use the maximal alignment rather than the specified alignment. Address this by sniffing the "Args" provided in the TableGen description of attributes. If the first argument is "obviously" something that should be treated as an expression (rather than an identifier to be matched later), parse it as an expression. Fixes <rdar://problem/13700933>. llvm-svn: 180970
* Fix crasher when the range in a C++ range-for loop has an ill-formed ↵Douglas Gregor2013-05-021-2/+11
| | | | | | | | initializer. Fixes <rdar://problem/13712739>. llvm-svn: 180937
* PR15884: In the 'taking the address of a temporary' extension, materialize theRichard Smith2013-05-011-0/+3
| | | | | | | | temporary to an lvalue before taking its address. This removes a weird special case from the AST representation, and allows the constant expression evaluator to deal with it without (broken) hacks. llvm-svn: 180866
* Point diagnostics that complain about a use of a selector in an objc ↵Argyrios Kyrtzidis2013-05-011-24/+41
| | | | | | | | | | | | message, to the selector location. Previously it would point to the left bracket or the receiver, which can be particularly problematic if the receiver is a block literal and we end up point the diagnostic far away for the selector that is complaining about. rdar://13620447 llvm-svn: 180833
* Fix PR15845: apparently MSVC does not support implicit int in C++ mode.Richard Smith2013-04-302-5/+2
| | | | llvm-svn: 180822
* When deducing an 'auto' type, don't modify the type-as-written.Richard Smith2013-04-304-52/+45
| | | | llvm-svn: 180808
* Don't treat a non-deduced 'auto' type as being type-dependent. Instead, thereRichard Smith2013-04-307-105/+107
| | | | | | | | are now two distinct canonical 'AutoType's: one is the undeduced 'auto' placeholder type, and the other is a deduced-but-dependent type. All deduced-to-a-non-dependent-type cases are still non-canonical. llvm-svn: 180789
* Fix very confusing indent in Sema.cpp.Daniel Jasper2013-04-301-6/+5
| | | | | | | This came up during my Euro LLVM 2013 talk on clang-format and I was asked to submit it :-). llvm-svn: 180772
* Objective-C (mostly arc): Under ARC, we often have unneeded qualifiers Fariborz Jahanian2013-04-301-0/+4
| | | | | | | in the diagnostics. Remove them when reporting incompatible Objective-C pointer types. // rdar://13752880. llvm-svn: 180765
* c language: diagnose use of "[*]" on any array dimensionFariborz Jahanian2013-04-291-1/+3
| | | | | | | | in the parameter of a function definition. Currently, it crashes in irgen if it is on other than the 1st dimension. // rdar://13705391 llvm-svn: 180732
* Use ArrayRef in AddMethodCandidate.Rafael Espindola2013-04-291-6/+9
| | | | | | Patch by Robert Wilhelm! llvm-svn: 180724
* Small CapturedStmt improvementsBen Langmuir2013-04-293-24/+19
| | | | | | | | | | | | | Add a CapturedStmt.h similar to Lambda.h to reduce the typing required to get to the CapturedRegionKind enum. This also allows codegen to access this enum without including Sema/ScopeInfo.h. Also removes some duplicated code for capturing 'this' between CapturedStmt and Lambda. Differential Revision: http://llvm-reviews.chandlerc.com/D712 llvm-svn: 180710
* Test commitBen Langmuir2013-04-291-1/+1
| | | | llvm-svn: 180709
* Implement DR580: access checks for template parameters of a class template areRichard Smith2013-04-291-9/+9
| | | | | | performed within the context of that class template. Patch by Ismail Pazarbasi! llvm-svn: 180707
* Fix an assertion failure / accepts-invalid in -fms-extensions mode. Don't buildRichard Smith2013-04-291-8/+10
| | | | | | | | | a dependent-scope id expression when a templated member function of a non-templated class references an unknown identifier, since instantiation won't rebuild it (and we can tell at parse time that it'll never work). Based on a patch by Faisal Vali! llvm-svn: 180701
* ArrayRef'ize Sema::ActOnEnumBody. No functionality change.Dmitri Gribenko2013-04-272-10/+10
| | | | | | Patch by Robert Wilhelm. llvm-svn: 180682
* Silence a silly sign compare warning from GCC.Benjamin Kramer2013-04-271-1/+1
| | | | llvm-svn: 180673
* Fix an assertion hit in Sema::CheckObjCMethodOverrides.Argyrios Kyrtzidis2013-04-271-4/+6
| | | | llvm-svn: 180651
* Implement C++1y decltype(auto).Richard Smith2013-04-267-25/+131
| | | | llvm-svn: 180610
* C++1y: support simple variable assignments in constexpr functions.Richard Smith2013-04-262-5/+7
| | | | llvm-svn: 180603
* Add r180263 back, but fix hasBraces() to be correct during parsing.Rafael Espindola2013-04-261-1/+2
| | | | | | | | Original commit message: Fix a case in linkage computation that should check for single line extern "C". llvm-svn: 180591
* Objective-C: This is a small modification to myFariborz Jahanian2013-04-251-2/+2
| | | | | | | | | | patch -n r180198. When reporting on missing property accessor implementation in categories, do not report when they are declared in primary class, class's protocol, or one of it super classes or in of the other categories. // rdar://13713098 llvm-svn: 180580
* Put friend decls in the correct context.Rafael Espindola2013-04-251-15/+25
| | | | | | | | | | When we find a friend declaration we have to skip transparent contexts for doing lookups, but we should not skip them when inserting the new decl if the lookup found nothing. Fixes PR15841. llvm-svn: 180571
* Don't mark 'extern "C" void f(void)' as having extern storage class.Rafael Espindola2013-04-251-10/+16
| | | | | | | | | | Instead, we check for one line extern "C" context in linkage computation and when deciding if a variable is a definition. This hopefully completes the transition to having "as written" semantics for hasExternalStorage. llvm-svn: 180258
* Objective-C arc: Improve disgnostics when 'weak'Fariborz Jahanian2013-04-241-2/+4
| | | | | | | | property cannot be synthesized because its backing ivar does not support weak references. // rdar://13676793 llvm-svn: 180211
* Objective-C: When reporting on missing property accessor implementation inFariborz Jahanian2013-04-242-17/+37
| | | | | | | | categories, do not report when they are declared in primary class, class's protocol, or one of it super classes. This is because, its class is going to implement them. // rdar://13713098 llvm-svn: 180198
* When modifying an implicit instantiation with information from an explicit ↵Argyrios Kyrtzidis2013-04-221-0/+1
| | | | | | | | | | one, make sure to reset the "right brace" location. Otherwise the source range of the explicit instantiation may become invalid (begin location will be after the end location). rdar://13706991 llvm-svn: 180070
* Add a warning for Objective-C pointer introspection, which is solely the job ↵Ted Kremenek2013-04-221-0/+31
| | | | | | of the Objective-C runtime. llvm-svn: 180062
* [ms-inline asm] Set the OpDecl to the InlineAsmIdentifierInfo struct.Chad Rosier2013-04-221-0/+1
| | | | | | Part of rdar://13663589 llvm-svn: 180055
* [ms-inline asm] Refactor/clean up the SemaLookup interface. No functionalChad Rosier2013-04-221-23/+13
| | | | | | | change indended. Part of rdar://13663589 llvm-svn: 180027
* C++1y constexpr extensions, round 1: Allow most forms of declaration andRichard Smith2013-04-224-53/+205
| | | | | | | | statement in constexpr functions. Everything which doesn't require variable mutation is also allowed as an extension in C++11. 'void' becomes a literal type to support constexpr functions which return 'void'. llvm-svn: 180022
OpenPOWER on IntegriCloud