summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* Several improvements to template argument deduction:Douglas Gregor2009-06-054-23/+247
| | | | | | | | | | | | | | - Once we have deduced template arguments for a class template partial specialization, we use exactly those template arguments for instantiating the definition of the class template partial specialization. - Added template argument deduction for non-type template parameters. - Added template argument deduction for dependently-sized array types. With these changes, we can now implement, e.g., the remove_reference type trait. Also, Daniel's Ackermann template metaprogram now compiles properly. llvm-svn: 72909
* Fix up this compatibility hack to be more compatible with gcc.Eli Friedman2009-06-041-3/+4
| | | | llvm-svn: 72901
* More refactoring/cleanup of objc ivars.Fariborz Jahanian2009-06-041-22/+11
| | | | llvm-svn: 72871
* Template argument deduction for incomplete and constant array types. Doug, ↵Anders Carlsson2009-06-041-0/+29
| | | | | | please review. llvm-svn: 72844
* Make sure to call FullExpr before parsing anything else.Anders Carlsson2009-06-041-2/+6
| | | | llvm-svn: 72834
* Template argument deduction for referencesDouglas Gregor2009-06-041-8/+35
| | | | llvm-svn: 72822
* When performing template argument deduction, ensure that multipleDouglas Gregor2009-06-045-94/+140
| | | | | | | | | | deductions of the same template parameter are equivalent. This allows us to implement the is_same type trait (!). Also, move template argument deduction into its own file and update a few build systems with this change (grrrr). llvm-svn: 72819
* Minor cleanup for implicit int warnings.Eli Friedman2009-06-031-2/+2
| | | | llvm-svn: 72770
* Use "()" instead of "(void)" when pretty-printing a parameter-less function ↵Argyrios Kyrtzidis2009-06-031-1/+1
| | | | | | type for C++. llvm-svn: 72747
* PR4142: Add %m format string specifier.Eli Friedman2009-06-021-0/+5
| | | | llvm-svn: 72726
* PR4287: allow a variadic prototype to make a subsequent K&R style Eli Friedman2009-06-012-14/+22
| | | | | | | | definition variadic. I'm not completely sure it's legal, but the standard can be interpreted as making it legal, and gcc seems to think it's legal, so I didn't add an extension warning. llvm-svn: 72689
* Make sure to copy back arguments that can be changed by ↵Anders Carlsson2009-05-311-0/+5
| | | | | | FindAllocationOverload. This fixes placement new. (Sebastian, please review). llvm-svn: 72673
* Fix an off by one error when trying to perform copy initialization of ↵Anders Carlsson2009-05-311-1/+1
| | | | | | operator new and operator delete arguments. Sebastian, please review. llvm-svn: 72670
* Downgrade an error about "return in a no-return function" from being Chris Lattner2009-05-311-4/+2
| | | | | | | | an error to being a warning that defaults to error. If you want this to be a warning, you have to explicitly pass -Winvalid-noreturn to clang to map it back to a warning. llvm-svn: 72669
* Disallow exception specs on typedefs.Sebastian Redl2009-05-312-7/+10
| | | | llvm-svn: 72664
* Fix for PR4285: allow intializing a const wchar_t array with a wide Eli Friedman2009-05-311-8/+10
| | | | | | string. llvm-svn: 72663
* Initial infrastructure for class template partial specialization. HereDouglas Gregor2009-05-313-19/+173
| | | | | | | | | | | | | we have the basics of declaring and storing class template partial specializations, matching class template partial specializations at instantiation time via (limited) template argument deduction, and using the class template partial specialization's pattern for instantiation. This patch is enough to make a simple is_pointer type trait work, but not much else. llvm-svn: 72662
* Forgot the implementation. Thanks Eli.Anders Carlsson2009-05-301-0/+41
| | | | llvm-svn: 72647
* Add RemoveOutermostTemporaryBinding. Not used yet.Anders Carlsson2009-05-301-0/+11
| | | | llvm-svn: 72644
* Clean up the newly added C++ AST nodes.Anders Carlsson2009-05-301-3/+3
| | | | llvm-svn: 72643
* It's OK for a full expr to be null. This fixes the failing test cases.Anders Carlsson2009-05-301-3/+2
| | | | llvm-svn: 72642
* ActOnReturnStmt should also take a FullExprArg.Anders Carlsson2009-05-303-4/+4
| | | | llvm-svn: 72641
* AddInitializerToDecl needs to take a full expression.Anders Carlsson2009-05-303-4/+4
| | | | llvm-svn: 72640
* Add the newly created temporary to the ExprTemporaries stack.Anders Carlsson2009-05-301-1/+2
| | | | llvm-svn: 72638
* Stop using CXXTempVarDecl and use CXXTemporary instead.Anders Carlsson2009-05-302-5/+2
| | | | llvm-svn: 72634
* Remove VarDecl from CXXConstructExpr.Anders Carlsson2009-05-304-15/+6
| | | | llvm-svn: 72633
* Bind temporaries correctly when instantiating expressions.Anders Carlsson2009-05-301-1/+1
| | | | llvm-svn: 72632
* Remove VarDecl from CheckInitializerTypes now that CXXConstructExpr doesn't ↵Anders Carlsson2009-05-303-10/+5
| | | | | | need to take a VarDecl anymore. (It still does, but it won't for long) llvm-svn: 72630
* Add Sema::MaybeBindToTemporary which takes an expression and (if needed) ↵Anders Carlsson2009-05-302-5/+27
| | | | | | wraps it in a CXXBindTemporaryExpr. Use this when creating CXXTemporaryObjectExprs. llvm-svn: 72629
* Add a CXXBindTemporaryExpr.Anders Carlsson2009-05-301-0/+10
| | | | llvm-svn: 72627
* Replace a cast with a dyn_cast as suggested by Doug.Anders Carlsson2009-05-301-7/+8
| | | | llvm-svn: 72624
* Pretty printing and improved representation for namespace alias declarationsDouglas Gregor2009-05-301-1/+3
| | | | llvm-svn: 72616
* Printing for using directives, e.g.,Douglas Gregor2009-05-301-2/+6
| | | | | | | | | using namespace std::debug; Extended UsingDirectiveDecl to store the nested-name-specifier that precedes the nominated namespace. llvm-svn: 72614
* Add a member lookup criteria constructor for searching for overridden ↵Anders Carlsson2009-05-303-14/+24
| | | | | | virtual member functions. Use this instead of regular name lookup when checking for overriding functions so we will see declarations that would otherwise be hidden. Fixes 6902298. llvm-svn: 72601
* Refactor and clean up the AST printer, so that it uses a DeclVisitor,Douglas Gregor2009-05-301-2/+4
| | | | | | | | | walks through DeclContexts properly, and prints more of the information available in the AST. The functionality is still available via -ast-print, -ast-dump, etc., and also via the new member functions Decl::dump() and Decl::print(). llvm-svn: 72597
* Make the LookupBase boolean an enum instead.Anders Carlsson2009-05-292-7/+17
| | | | llvm-svn: 72594
* Create a new PrintingPolicy class, which we pass down through the ASTDouglas Gregor2009-05-292-2/+3
| | | | | | | | | printing logic to help customize the output. For now, we use this rather than a special flag to suppress the "struct" when printing "struct X" and to print the Boolean type as "bool" in C++ but "_Bool" in C. llvm-svn: 72590
* Make sure we don't give the wrong warning, and make sure not to set Eli Friedman2009-05-291-6/+9
| | | | | | | hadError (suppressing future diagnostics) if we didn't print an error. llvm-svn: 72588
* Add an assertion so that we don't accidentally build constant arrays of Eli Friedman2009-05-291-1/+1
| | | | | | VLAs. llvm-svn: 72587
* Reduce the amount of stack space we use in SmallVectors duringDouglas Gregor2009-05-294-13/+13
| | | | | | | template instantiation. This helps reduce our stack footprint when performing deep template instantiations. llvm-svn: 72582
* Revert r72575, which isn't really right, and fix up other code to Eli Friedman2009-05-291-20/+20
| | | | | | handle the construct in question correctly. llvm-svn: 72581
* Reject incomplete types in exception specs.Sebastian Redl2009-05-293-8/+55
| | | | llvm-svn: 72580
* Avoid dumping during semantic analysis when checking array types whenMike Stump2009-05-291-15/+16
| | | | | | a vla is used. llvm-svn: 72575
* Disallow exception specifications on multi-level indirections.Sebastian Redl2009-05-292-0/+47
| | | | llvm-svn: 72571
* Some cleanups and commenting to our declaration-name handlingDouglas Gregor2009-05-291-11/+5
| | | | llvm-svn: 72570
* Now that we have declared/defined tag types within DeclGroups,Douglas Gregor2009-05-292-7/+1
| | | | | | | | | | | | | instantiation of tags local to member functions of class templates (and, eventually, function templates) works when the tag is defined as part of the decl-specifier-seq, e.g., struct S { T x, y; } s1; Also, make sure that we don't try to default-initialize a dependent type. llvm-svn: 72568
* If a declarator group declares a type, make sure to add that declaration Eli Friedman2009-05-292-3/+8
| | | | | | to the DeclGroup. llvm-svn: 72559
* When we parse a tag specifier, keep track of whether that tagDouglas Gregor2009-05-284-9/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | specifier resulted in the creation of a new TagDecl node, which happens either when the tag specifier was a definition or when the tag specifier was the first declaration of that tag type. This information has several uses, the first of which is implemented in this commit: 1) In C++, one is not allowed to define tag types within a type specifier (e.g., static_cast<struct S { int x; } *>(0) is ill-formed) or within the result or parameter types of a function. We now diagnose this. 2) We can extend DeclGroups to contain information about any tags that are declared/defined within the declaration specifiers of a variable, e.g., struct Point { int x, y, z; } p; This will help improve AST printing and template instantiation, among other things. 3) For C99, we can keep track of whether a tag type is defined within the type of a parameter, to properly cope with cases like, e.g., int bar(struct T2 { int x; } y) { struct T2 z; } We can also do similar things wherever there is a type specifier, e.g., to keep track of where the definition of S occurs in this legal C99 code: (struct S { int x, y; } *)0 llvm-svn: 72555
* Introduced DeclContext::isDependentContext, which determines whether aDouglas Gregor2009-05-281-0/+7
| | | | | | | | | | | | | | | | | | | given DeclContext is dependent on type parameters. Use this to properly determine whether a TagDecl is dependent; previously, we were missing the case where the TagDecl is a local class of a member function of a class template (phew!). Also, make sure that, when we instantiate declarations within a member function of a class template (or a function template, eventually), that we add those declarations to the "instantiated locals" map so that they can be found when instantiating declaration references. Unfortunately, I was not able to write a useful test for this change, although the assert() that fires when uncommenting the FIXME'd line in test/SemaTemplate/instantiate-declref.cpp tells the "experienced user" that we're now doing the right thing. llvm-svn: 72526
* Reimplement much of the way that we track nested classes in theDouglas Gregor2009-05-273-2/+19
| | | | | | | | | | | | | parser. Rather than placing all of the delayed member function declarations and inline definitions into a single bucket corresponding to the top-level class, we instead mirror the nesting structure of the nested classes and place the delayed member functions into their appropriate place. Then, when we actually parse the delayed member function declarations, set up the scope stack the same way as it was when we originally saw the declaration, so that we can find, e.g., template parameters that are in scope. llvm-svn: 72502
OpenPOWER on IntegriCloud