summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* Make -code-completion-patterns only cover multi-line codeDouglas Gregor2010-05-281-241/+247
| | | | | | | completions. Plus, tweak a few completion patterns to better reflect the language grammar. llvm-svn: 104905
* Implement a code-completion hook for the receiver of an Objective-CDouglas Gregor2010-05-272-1/+99
| | | | | | | message. This completion gives better results than just using the "expression" completion, which is effectively what happened before. llvm-svn: 104895
* Tweak the fix-it for a copy constructor declared to take its argumentDouglas Gregor2010-05-271-1/+4
| | | | | | by-value. We now only prepend a space if it is needed. llvm-svn: 104889
* Parse/Sema: Add support for '#pragma options align=packed', which, it should beDaniel Dunbar2010-05-271-0/+7
| | | | | | noted, is not the same as __attribute__((packed)). That would be ridiculous! llvm-svn: 104865
* Parse/Sema: Add support for '#pragma options align=native'.Daniel Dunbar2010-05-271-0/+4
| | | | llvm-svn: 104864
* Require a complete type when performing the qualified lookup duringJohn McCall2010-05-271-0/+3
| | | | | | instantiation of a dependent elaborated type specifier. Fixes PR 7199. llvm-svn: 104822
* Sema: Add initial support for '#pragma options align=mac68k'.Daniel Dunbar2010-05-271-7/+16
| | | | | | | - Docs are fairly sketchy, if someone wants to pore through gcc to look for holes I'd appreciate any failing test cases! llvm-svn: 104809
* Sema: Factor out struct for alignment stack entries.Daniel Dunbar2010-05-271-5/+11
| | | | llvm-svn: 104799
* Sema: Replace getPragmaPackAlignment with AddAlignmentAttributesForRecord, whichDaniel Dunbar2010-05-273-17/+18
| | | | | | exposes less details. llvm-svn: 104797
* AST: Rename PragmaPackAttr to MaxFieldAlignmentAttr, which is more accurate.Daniel Dunbar2010-05-271-1/+1
| | | | llvm-svn: 104795
* Sema: Reject '#pragma options align=mac68k' everywhere except i386-apple-darwin.Daniel Dunbar2010-05-271-0/+14
| | | | llvm-svn: 104789
* Sema: Support for #pragma options align={reset,natural}. '#pragma options align'Daniel Dunbar2010-05-272-1/+41
| | | | | | shares the stack with '#pragma pack', who knew!? llvm-svn: 104786
* Introduce priorities into the code-completion results.Douglas Gregor2010-05-262-40/+78
| | | | llvm-svn: 104751
* Improve on flexible array diagnostics (PR7029).Fariborz Jahanian2010-05-261-1/+1
| | | | llvm-svn: 104739
* Fixes misc. flexible array bugs in c++ (PR7029).Fariborz Jahanian2010-05-262-1/+21
| | | | llvm-svn: 104733
* Added source order to CXXBaseOrMemberInitializer.Abramo Bagnara2010-05-261-0/+3
| | | | llvm-svn: 104712
* When transforming a C++ "new" expression's constructor arguments, dropDouglas Gregor2010-05-261-0/+3
| | | | | | | | | any arguments that are default-argument expressions. The can show up when we have a new expression whose constructor arguments are not type-dependent and whose allocated type is not dependent and has a constructor with default arguments. Fixes PR7202. llvm-svn: 104690
* Tell the string literal parser when it's not permitted to emitDouglas Gregor2010-05-261-2/+3
| | | | | | | | diagnostics. That would be while we're parsing string literals for the sole purpose of producing a diagnostic about them. Fixes <rdar://problem/8026030>. llvm-svn: 104684
* Only enable code patterns (e.g., try { statements } catch (...) {Douglas Gregor2010-05-251-204/+246
| | | | | | statements }) in the code-completion results if explicitly requested. llvm-svn: 104637
* Make sure to strip off top-level cv-qualifiers as part of aDouglas Gregor2010-05-251-1/+1
| | | | | | derived-to-base conversion on a pointer. Fixes PR7224. llvm-svn: 104607
* Improve code completion in failure cases in two ways:Douglas Gregor2010-05-252-22/+6
| | | | | | | | | | | 1) Suppress diagnostics as soon as we form the code-completion token, so we don't get any error/warning spew from the early end-of-file. 2) If we consume a code-completion token when we weren't expecting one, go into a code-completion recovery path that produces the best results it can based on the context that the parser is in. llvm-svn: 104585
* IRgen/C++: When mark vtables used, make sure to still append to the ↵Daniel Dunbar2010-05-251-2/+9
| | | | | | | | | VTableUse array if we promote a vtable from being just used to having its definition required. This ensures that we properly inform the consumer about whether the vtable is required or not, previously we could fail to do so when the vtable was in the VTableUses array before the decl which marked it as required. - I think this can be cleaned up, since this means we may notify the consumer about the vtable twice, but I didn't see an easy fix for this without more substantial refactoring. - Doug, please review! llvm-svn: 104577
* Simplify.Daniel Dunbar2010-05-251-2/+1
| | | | llvm-svn: 104576
* Don't complain about VLAs of non-POD types when the array type isDouglas Gregor2010-05-241-1/+2
| | | | | | dependent. Fixes <rdar://problem/8021385>. llvm-svn: 104550
* Make sure that we instantiate variably modified types, even if theyDouglas Gregor2010-05-242-7/+11
| | | | | | aren't dependent. Fixes <rdar://problem/8020206>. llvm-svn: 104511
* Downgrade deletion of a void* from an error (which is should be) to anDouglas Gregor2010-05-241-1/+7
| | | | | | | extension warning (which other compilers seem to use). Works around a known bug in Xalan. llvm-svn: 104509
* An identity conversion is better than any non-identityDouglas Gregor2010-05-232-0/+15
| | | | | | conversion. Fixes PR7095. llvm-svn: 104476
* In C++, one cannot assign from an arithmetic type to an enumerationDouglas Gregor2010-05-231-1/+2
| | | | | | type. Fixes PR7051. llvm-svn: 104475
* It turns out that people love using VLAs in templates, too. Weaken ourDouglas Gregor2010-05-232-16/+13
| | | | | | | | VLA restrictions so that one can use VLAs in templates (even accidentally), but not as part of a non-type template parameter (which would be very bad). llvm-svn: 104471
* Complain about sizeof(overloaded function) rather than crashing.Douglas Gregor2010-05-231-0/+6
| | | | llvm-svn: 104470
* Provide the overloaded functions for UnresolvedLookupExpr andDouglas Gregor2010-05-233-13/+12
| | | | | | | UnresolvedMemberExpr in their constructors, rather than adding them after the fact. No functionality change. llvm-svn: 104468
* Don't look for a destructor in a dependent type. Fixes PR7198.Douglas Gregor2010-05-221-1/+1
| | | | llvm-svn: 104445
* When determining whether we can use "this", make sure to look throughDouglas Gregor2010-05-221-1/+1
| | | | | | | enum contexts (along with block contexts, which we already did). Fixes PR7196. llvm-svn: 104444
* Implement support for variable length arrays in C++. VLAs are limitedDouglas Gregor2010-05-222-9/+34
| | | | | | | | | | | | | in several important ways: - VLAs of non-POD types are not permitted. - VLAs cannot be used in conjunction with C++ templates. These restrictions are intended to keep VLAs out of the parts of the C++ type system where they cause the most trouble. Fixes PR5678 and <rdar://problem/8013618>. llvm-svn: 104443
* Improve our handling of reference binding for subobjects ofDouglas Gregor2010-05-222-18/+25
| | | | | | | | | | | | | | | | | | | | | | | | | temporaries. There are actually several interrelated fixes here: - When converting an object to a base class, it's only an lvalue cast when the original object was an lvalue and we aren't casting pointer-to-derived to pointer-to-base. Previously, we were misclassifying derived-to-base casts of class rvalues as lvalues, causing various oddities (including problems with reference binding not extending the lifetimes of some temporaries). - Teach the code for emitting a reference binding how to look through no-op casts and parentheses directly, since Expr::IgnoreParenNoOpCasts is just plain wrong for this. Also, make sure that we properly look through multiple levels of indirection from the temporary object, but destroy the actual temporary object; this fixes the reference-binding issue mentioned above. - Teach Objective-C message sends to bind the result as a temporary when needed. This is actually John's change, but it triggered the reference-binding problem above, so it's included here. Now John can actually test his return-slot improvements. llvm-svn: 104434
* Improve recovery when we see a dependent template name that is missingDouglas Gregor2010-05-211-0/+1
| | | | | | | | | | | | | | | the required "template" keyword, using the same heuristics we do for dependent template names in member access expressions, e.g., test/SemaTemplate/dependent-template-recover.cpp:11:8: error: use 'template' keyword to treat 'getAs' as a dependent template name T::getAs<U>(); ^ template Fixes PR5404. llvm-svn: 104409
* Clang missing warning about conflicting declaration vs. definition Fariborz Jahanian2010-05-211-0/+4
| | | | | | for variable arguments list methods. (radar 8006060). llvm-svn: 104407
* Improve parser recovery when we encounter a dependent template nameDouglas Gregor2010-05-214-10/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that is missing the 'template' keyword, e.g., t->getAs<T>() where getAs is a member of an unknown specialization. C++ requires that we treat "getAs" as a value, but that would fail to parse since T is the name of a type. We would then fail at the '>', since a type cannot be followed by a '>'. This is a very common error for C++ programmers to make, especially since GCC occasionally allows it when it shouldn't (as does Visual C++). So, when we are in this case, we use tentative parsing to see if the tokens starting at "<" can only be parsed as a template argument list. If so, we produce a diagnostic with a fix-it that states that the 'template' keyword is needed: test/SemaTemplate/dependent-template-recover.cpp:5:8: error: 'template' keyword is required to treat 'getAs' as a dependent template name t->getAs<T>(); ^ template This is just a start of this patch; I'd like to apply the same approach to everywhere that a template-id with dependent template name can be parsed. llvm-svn: 104406
* When instantiating a function declaration within a function template,Douglas Gregor2010-05-211-0/+1
| | | | | | | be sure to merge its parameter scope with its parent's scope. Fixes PR7184. llvm-svn: 104386
* Propagate access specifiers to anonymous union members nested within classes.John McCall2010-05-212-14/+23
| | | | | | Fixes <rdar://problem/7987650>. llvm-svn: 104376
* Use CanQualType to enforce the use of a canonical type argument toDouglas Gregor2010-05-212-2/+2
| | | | | | | CXXBasePaths::isAmbiguous(), rather than just asserting that we have a canonical type. Fixes PR7176. llvm-svn: 104374
* Introduce a method to get from an anonymous struct or union record declarationJohn McCall2010-05-211-30/+1
| | | | | | to the associated object declaration. llvm-svn: 104309
* When instantiating anonymous structs/unions within a function, makeDouglas Gregor2010-05-211-1/+18
| | | | | | | | | sure that the anonymous struct/union record declaration gets instantiated before the variable declaration, and that it and its fields (recursively) get entries in the local instantiation map. Fixes PR7088. llvm-svn: 104305
* Fix a crasher in constructor-initializer reordering warnings (PR7179).Douglas Gregor2010-05-201-3/+1
| | | | llvm-svn: 104299
* Generate objc_memmove_collectable write-barrier for Fariborz Jahanian2010-05-201-1/+7
| | | | | | classes whose base class have GC'able object pointers. llvm-svn: 104296
* Be sure to apply initializers to members of anonymous structs and unionsJohn McCall2010-05-201-61/+92
| | | | | | | | recursively, e.g. so that members of anonymous unions inside anonymous structs still get initialized. Also generate default constructor calls for anonymous struct members when necessary. llvm-svn: 104292
* Add a new failure kind, FK_Incomplete, to InitializationSequence, toDouglas Gregor2010-05-203-2/+17
| | | | | | | | | capture failures when we try to initialize an incomplete type. Previously, we would (ab)use FK_ConversionFailed, then occasionally dereference a null pointer when trying to diagnose the failure. Fixes <rdar://problem/7959007>. llvm-svn: 104286
* Reinstate r104117, Chandler Carruth's change that "[provides] a namingDouglas Gregor2010-05-202-12/+11
| | | | | | | class for UnresolvedLookupExprs, even when occuring on template names" along with a fix for an Objective-C++ crasher it introduced. llvm-svn: 104277
* Added TemplateArgumentListInfo to FunctionTemplateSpecializationInfo.Abramo Bagnara2010-05-201-24/+18
| | | | llvm-svn: 104226
* Renamed misleading getSourceRange -> getLocalSourceRange and ↵Abramo Bagnara2010-05-205-15/+15
| | | | | | getFullSourceRange -> getSourceRange for TypeLoc. llvm-svn: 104220
OpenPOWER on IntegriCloud