summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
* Instantiation support for 'this'Anders Carlsson2009-05-151-0/+12
| | | | llvm-svn: 71886
* No need to null check the expr, Sema::SemaRef.InstantiateExpr handles all that.Anders Carlsson2009-05-151-7/+4
| | | | llvm-svn: 71885
* Make sure that the type associated with a class template is dependent.Douglas Gregor2009-05-151-1/+10
| | | | llvm-svn: 71878
* Template instantiation for "if" statements. Also:Douglas Gregor2009-05-152-12/+36
| | | | | | | | - Skip semantic analysis of the "if" condition if it is type-dependent. - Added the location of the "else" keyword into IfStmt, so that we can provide it for type-checking after template instantiation. llvm-svn: 71875
* Move statement instantiation into its own file. No functionality changeDouglas Gregor2009-05-153-132/+153
| | | | llvm-svn: 71872
* Call ActOnStartOfFunctionDecl/ActOnFinishFunctionBody whenDouglas Gregor2009-05-154-15/+25
| | | | | | instantiating the definition of a function from a template. llvm-svn: 71869
* Instantiate return statements.Anders Carlsson2009-05-152-1/+15
| | | | llvm-svn: 71825
* Add NullStmt::Clone and use itAnders Carlsson2009-05-151-1/+1
| | | | llvm-svn: 71823
* Instantiate goto and label statements. (Very useful, I know)Anders Carlsson2009-05-151-0/+18
| | | | llvm-svn: 71822
* Implement template instantiation for DeclStmtDouglas Gregor2009-05-153-2/+34
| | | | llvm-svn: 71818
* Don't warn if result/argument type of an implemented Fariborz Jahanian2009-05-143-2/+15
| | | | | | | method is a qualified id which conforms to the matching type of its method declaration. llvm-svn: 71817
* Template instantiation for the NULL statement. Lame, I knowDouglas Gregor2009-05-141-0/+5
| | | | llvm-svn: 71816
* Introduce basic support for instantiating the definitions of memberDouglas Gregor2009-05-145-15/+121
| | | | | | | functions of class templates. Only compound statements and expression statements are currently implemented. llvm-svn: 71814
* Check that the function being overridden is virtual.Anders Carlsson2009-05-142-4/+6
| | | | llvm-svn: 71802
* Improvements to the FunctionDecl getters/setters.Anders Carlsson2009-05-141-1/+1
| | | | llvm-svn: 71800
* Introduce a stack of instantiation scopes that are used to store the mapping ↵Douglas Gregor2009-05-144-1/+87
| | | | | | from variable declarations that occur within templates to their instantiated counterparts llvm-svn: 71799
* Link FunctionDecls instantiated from the member functions of a classDouglas Gregor2009-05-141-6/+22
| | | | | | | | template to the FunctionDecls from which they were instantiated. This is a necessary first step to support instantiation of the definitions of such functions, but by itself does essentially nothing. llvm-svn: 71792
* updated comments.Fariborz Jahanian2009-05-141-3/+2
| | | | llvm-svn: 71790
* Adds recognition of sentinel attribute on block declarations.Fariborz Jahanian2009-05-142-3/+37
| | | | llvm-svn: 71788
* Better diagnostics for covariance when checking overriding return types.Anders Carlsson2009-05-141-6/+65
| | | | llvm-svn: 71786
* When there are any member new operators, global versions aren't looked up at ↵Sebastian Redl2009-05-141-2/+0
| | | | | | all. llvm-svn: 71780
* Diagnose missing sentinel argument on a funciton callFariborz Jahanian2009-05-141-17/+39
| | | | | | with sentinel attribute. llvm-svn: 71778
* In C++, warn when something previously declared as a "struct" is laterDouglas Gregor2009-05-143-34/+57
| | | | | | | declared as a "class", or vice-versa. This warning is under the control of -Wmismatched-tags, which is off by default. llvm-svn: 71773
* Add return type checking for overriding virtual functions. We currently ↵Anders Carlsson2009-05-143-4/+59
| | | | | | don't check covariance but that's next. llvm-svn: 71759
* Implement explicit instantiations of member classes of class templates, e.g.,Douglas Gregor2009-05-146-10/+99
| | | | | | | | | | | | | | | | | | | | | | | | | template<typename T> struct X { struct Inner; }; template struct X<int>::Inner; This change is larger than it looks because it also fixes some a problem with nested-name-specifiers and tags. We weren't requiring the DeclContext associated with the scope specifier of a tag to be complete. Therefore, when looking for something like "struct X<int>::Inner", we weren't instantiating X<int>. This, naturally, uncovered a problem with member pointers, where we were requiring the left-hand side of a member pointer access expression (e.g., x->*) to be a complete type. However, this is wrong: the semantics of this expression does not require a complete type (EDG agrees). Stuart vouched for me. Blame him. llvm-svn: 71756
* Look for and diagnose missing sentinel argument on messageFariborz Jahanian2009-05-132-2/+45
| | | | | | dispatch arguments which have sentinel attribute. llvm-svn: 71737
* Use an iterator type for found_decls_begin/found_decls_end.Anders Carlsson2009-05-132-4/+5
| | | | llvm-svn: 71721
* Add a new, more advanced CheckDerivedToBaseConversion that takes custom ↵Anders Carlsson2009-05-133-9/+33
| | | | | | diagnostic IDs. llvm-svn: 71720
* Add some basic type checking for attributes ns_returns_retained andTed Kremenek2009-05-131-39/+39
| | | | | | | | | | | | | | cf_returns_retained. Currently this attribute can now be applied to any Objective-C method or C function that returns a pointer or Objective-C object type. Modify the tablegen definition of diagnostic 'warn_attribute_wrong_decl_type' to expect that the diagnostics infrastructure will add quotes around the attribute name when appropriate. Alonq with this change, I modified the places where this warning is issued to passed the attribute's IdentifierInfo* instead of having a hard-coded C constant string. llvm-svn: 71718
* Explicit instantiations of templates now instantiate the definitionsDouglas Gregor2009-05-134-3/+83
| | | | | | | | of class members (recursively). Only member classes are actually instantiated; the instantiation logic for member functions and variables are just stubs. llvm-svn: 71713
* Disable access control by default. It can be enabled with the ↵Anders Carlsson2009-05-131-0/+3
| | | | | | -faccess-control option. When we have better support for it, we can enable it by default again. llvm-svn: 71706
* Improve the semantic checking for explicit instantiations ofDouglas Gregor2009-05-133-32/+114
| | | | | | | | | | | | | | | | templates. In particular: - An explicit instantiation can follow an implicit instantiation (we were improperly diagnosing this as an error, previously). - In C++0x, an explicit instantiation that follows an explicit specialization of the same template specialization is ignored. In C++98, we just emit an extension warning. - In C++0x, an explicit instantiation must be in a namespace enclosing the original template. C++98 has no such requirement. Also, fixed a longstanding FIXME regarding the integral type that is used for the size of a constant array type when it is being instantiated. llvm-svn: 71689
* Some early declarations to support sentinel attribute onFariborz Jahanian2009-05-133-0/+13
| | | | | | | message dispatches (and function calls later). No change in functionality. llvm-svn: 71683
* Fix <rdar://problem/6880975> [format string] Assertion failed: (Arg < ↵Ted Kremenek2009-05-131-25/+27
| | | | | | | | | NumArgs && "Arg access out of range!"). For format string checking, only check the type of the format specifier for non-vararg functions. llvm-svn: 71672
* Fix rdar://6880951 by rejecting vectors of vectors.Chris Lattner2009-05-131-2/+3
| | | | | | | | It seems dubious to me that isIntegerType() returns true for vectors of integers, but not complex integers. This should probably be rethought, I'll file a bugzilla. llvm-svn: 71640
* reject use of the GNU _Decimal32 extension with a diagnostic, not an abort.Chris Lattner2009-05-131-1/+4
| | | | | | rdar://6880104 llvm-svn: 71639
* eli correctly points out that this code is dead, just rip it out forChris Lattner2009-05-131-7/+0
| | | | | | now until someone does it right llvm-svn: 71638
* add support for __sync_nand_and_fetch and __sync_fetch_and_nand,Chris Lattner2009-05-131-9/+15
| | | | | | rdar://6880573 llvm-svn: 71636
* Fix rdar://6881069, a crash on a form of vector_size that weChris Lattner2009-05-131-1/+2
| | | | | | | | | don't support. While it would be nice to support this eventually, this form is not common at all (just seen in gcc testsuite) and it might be better to model vector_size as a type attribute anyway. For now just emit a nice error on it. llvm-svn: 71633
* Semantic analysis for explicit instantiation of class templates. WeDouglas Gregor2009-05-134-6/+158
| | | | | | | | still aren't instantiating the definitions of class template members, and core issues 275 and 259 will both affect the checking that we do for explicit instantiations (but are not yet implemented). llvm-svn: 71613
* Implement parsing for explicit instantiations of class templates, e.g.,Douglas Gregor2009-05-121-2/+5
| | | | | | | | | template class X<int>; This also cleans up the propagation of template information through declaration parsing, which is used to improve some diagnostics. llvm-svn: 71608
* improve the diagnostic for uses of the GCC "global variable in a register" ↵Chris Lattner2009-05-121-1/+7
| | | | | | | | extension. This implements rdar://6880449 - improve diagnostic for usage of "global register variable" GCC extension llvm-svn: 71599
* Method attributes may only be specified on methodFariborz Jahanian2009-05-121-0/+4
| | | | | | declarations. llvm-svn: 71597
* Method who have definitions in structs/classes are semantically inline.Chris Lattner2009-05-121-0/+7
| | | | | | | Per the FIXME, it might be interesting to track whether the inline keyword was also used on the method, but for now we don't do this. Testcase pending. llvm-svn: 71589
* Encapsulate template arguments lists in a new class,Douglas Gregor2009-05-116-104/+63
| | | | | | | | TemplateArgumentList. This avoids the need to pass around pointer/length pairs of template arguments lists, and will eventually make it easier to introduce member templates and variadic templates. llvm-svn: 71517
* Friend declarations are only valid inside class definitions.Anders Carlsson2009-05-112-0/+12
| | | | llvm-svn: 71489
* Implement the notions of the "current instantiation" and "unknownDouglas Gregor2009-05-116-29/+158
| | | | | | | | | | | | | | | | | | specialization" within a C++ template, and permit name lookup into the current instantiation. For example, given: template<typename T, typename U> struct X { typedef T type; X* x1; // current instantiation X<T, U> *x2; // current instantiation X<U, T> *x3; // not current instantiation ::X<type, U> *x4; // current instantiation X<typename X<type, U>::type, U>: *x5; // current instantiation }; llvm-svn: 71471
* With the introduction of nullptr, a template argument that refers to a ↵Douglas Gregor2009-05-101-4/+4
| | | | | | declaration can now be NULL. Use cast_or_null appropriately llvm-svn: 71412
* Implement the semantics of the injected-class-name within a classDouglas Gregor2009-05-103-18/+40
| | | | | | | | | | | | | | | | | | template. The injected-class-name is either a type or a template, depending on whether a '<' follows it. As a type, the injected-class-name's template argument list contains its template parameters in declaration order. As part of this, add logic for canonicalizing declarations, and be sure to canonicalize declarations used in template names and template arguments. A TagType is dependent if the declaration it references is dependent. I'm not happy about the rather complicated protocol needed to use ASTContext::getTemplateSpecializationType. llvm-svn: 71408
* Implement C++0x nullptr.Sebastian Redl2009-05-106-6/+72
| | | | llvm-svn: 71405
OpenPOWER on IntegriCloud