summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/instantiate-function-1.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Promote the extension warning for attempts to catch a reference orDouglas Gregor2012-01-241-1/+1
| | | | | | | | | | pointer to incomplete type from an ExtWarn to an error. We put the ExtWarn in place as part of a workaround for Boost (PR6527), but it (1) doesn't actually match a GCC extension and (2) has been fixed for two years in Boost, and (3) causes us to emit code that fails badly at run time, so it's a bad idea to keep it. Fixes PR11803. llvm-svn: 148838
* When determining whether we need to instantiate a function type,Douglas Gregor2011-05-091-0/+22
| | | | | | | also consider whether any of the parameter types (as written, prior to decay) are dependent. Fixes PR9880 and <rdar://problem/9408413>. llvm-svn: 131099
* Add -fcxx-exceptions to all tests that use C++ exceptions.Anders Carlsson2011-02-281-1/+1
| | | | llvm-svn: 126599
* Pass -fexceptions to all tests that use try/catch/throw.Anders Carlsson2011-02-191-1/+1
| | | | llvm-svn: 126037
* Continue to instantiate sub-statements in a CompoundStmt as long asJohn McCall2010-08-271-3/+3
| | | | | | | we don't see a DeclStmt (failure to instantiate which generally causes panic). llvm-svn: 112282
* fix PR7280 by making the warning on code like this:Chris Lattner2010-07-111-2/+2
| | | | | | | | | | int test1() { return; } default to an error. llvm-svn: 108108
* When instantiating a function-local variable definition, introduce theDouglas Gregor2010-05-031-0/+5
| | | | | | | | mapping from the declaration in the template to the instantiated declaration before transforming the initializer, in case some crazy lunatic decides to use a variable in its own initializer. Fixes PR7016. llvm-svn: 102945
* Fix a self-host problem caused by this over-eager assertion. I'm not sureJohn McCall2010-03-111-0/+6
| | | | | | there's a good equivalent that's actually true, unfortunately. llvm-svn: 98253
* Downgrade errors when trying to catch a pointer or reference toDouglas Gregor2010-03-081-1/+1
| | | | | | | | | incomplete type to warnings; GCC (and EDG in GCC compatibility mode) permit such handles. Fixes PR6527. (For real this time) llvm-svn: 97927
* Revert r97925, it only contained the test updates not the actual fix.Chandler Carruth2010-03-081-1/+1
| | | | llvm-svn: 97926
* Downgrade errors when trying to catch a pointer or reference toDouglas Gregor2010-03-071-1/+1
| | | | | | | incomplete type to warnings; GCC (and EDG in GCC compatibility mode) permit such handles. Fixes PR6527. llvm-svn: 97925
* avoid issues with the new scope protector. Previously we'd errorChris Lattner2010-03-011-2/+4
| | | | | | with "address taken of label in protected scope, jump to it would have unknown effect on scope" llvm-svn: 97495
* Switch the initialization required by return statements over to theDouglas Gregor2009-12-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | new InitializationSequence. This fixes some bugs (e.g., PR5808), changed some diagnostics, and caused more churn than expected. What's new: - InitializationSequence now has a "C conversion sequence" category and step kind, which falls back to - Changed the diagnostics for returns to always have the result type of the function first and the type of the expression second. CheckSingleAssignmentConstraints to peform checking in C. - Improved ASTs for initialization of return values. The ASTs now capture all of the temporaries we need to create, but intentionally do not bind the tempoary that is actually returned, so that it won't get destroyed twice. - Make sure to perform an (elidable!) copy of the class object that is returned from a class. - Fix copy elision in CodeGen to properly see through the subexpressions that occur with elidable copies. - Give "new" its own entity kind; as with return values and thrown objects, we don't bind the expression so we don't call a destructor for it. Note that, with this patch, I've broken returning move-only types in C++0x. We'll fix it later, when we tackle NRVO. llvm-svn: 91669
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-151-1/+1
| | | | | | | | | - This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target). llvm-svn: 91446
* "Do" loops cannot have condition variables, so don't parse them.Douglas Gregor2009-11-241-3/+0
| | | | llvm-svn: 89801
* Fix type of 'this' and add a decltype test.Anders Carlsson2009-07-101-1/+1
| | | | llvm-svn: 75291
* If a CXXRecordDecl is a class template, the 'this' type should be the ↵Anders Carlsson2009-06-131-1/+7
| | | | | | injected class name type. Fixes pr4383. llvm-svn: 73284
* Template instantiation for the GNU address-of-label extension.Douglas Gregor2009-05-221-0/+8
| | | | llvm-svn: 72301
* Introduce a new kind of RAII class, ASTOwningVector, which is anDouglas Gregor2009-05-201-1/+1
| | | | | | | | llvm::SmallVector that owns all of the AST nodes inside of it. This RAII class is used to ensure proper destruction of AST nodes when template instantiation fails. llvm-svn: 72186
* Template instantiation for CXXExprWithTemporaries, which occurs whenDouglas Gregor2009-05-201-0/+3
| | | | | | | | | | temporaries are generated for some object-constructing expressions in templates that are not type-dependent. Also, be sure to introduce the variable from a CXXConditionDeclExpr into the set of instantiated local variables. llvm-svn: 72185
* Template instantiation for C++ try/catch statements.Douglas Gregor2009-05-181-1/+19
| | | | llvm-svn: 72035
* Oops, dropped a -verifyDouglas Gregor2009-05-181-1/+1
| | | | llvm-svn: 72016
* When instantiating the definition of a member function of a classDouglas Gregor2009-05-181-3/+3
| | | | | | | | | | | | | | template, introduce that member function into the template instantiation stack. Also, add diagnostics showing the member function within the instantiation stack and clean up the qualified-name printing so that we get something like: note: in instantiation of member function 'Switch1<int, 2, 2>::f' requested here in the template instantiation backtrace. llvm-svn: 72015
* Template instantiation for IndirectGotoStmt. Now my life is complete.Douglas Gregor2009-05-161-0/+10
| | | | llvm-svn: 71917
* Template instantiation for switch statementsDouglas Gregor2009-05-151-0/+30
| | | | llvm-svn: 71916
* Basic support for member exprs where the base expr type is dependent.Anders Carlsson2009-05-151-0/+15
| | | | llvm-svn: 71907
* Template instantiation for break and continue statements.Douglas Gregor2009-05-151-0/+4
| | | | llvm-svn: 71903
* Template instantiation for "for" loopsDouglas Gregor2009-05-151-0/+9
| | | | llvm-svn: 71901
* Template instantiation for do-while statements.Douglas Gregor2009-05-151-0/+14
| | | | llvm-svn: 71899
* Template instantiation for WhileStmt and CXXConditionDeclExpr.Douglas Gregor2009-05-151-0/+11
| | | | llvm-svn: 71896
* Make sure that we use the canonical type for the names of instantiatedDouglas Gregor2009-05-151-2/+6
| | | | | | | | | | constructors and destructors. This is a requirement of DeclarationNameTable::getCXXSpecialName that we weren't assert()'ing, so it should have been caught much earlier :( Big thanks to Anders for the test case. llvm-svn: 71895
* Instantiation support for 'this'Anders Carlsson2009-05-151-0/+8
| | | | llvm-svn: 71886
* Template instantiation for "if" statements. Also:Douglas Gregor2009-05-151-0/+17
| | | | | | | | - 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
* Call ActOnStartOfFunctionDecl/ActOnFinishFunctionBody whenDouglas Gregor2009-05-151-1/+9
| | | | | | instantiating the definition of a function from a template. llvm-svn: 71869
* Instantiate return statements.Anders Carlsson2009-05-151-0/+13
| | | | llvm-svn: 71825
* Instantiate goto and label statements. (Very useful, I know)Anders Carlsson2009-05-151-0/+11
| | | | llvm-svn: 71822
* Implement template instantiation for DeclStmtDouglas Gregor2009-05-151-0/+3
| | | | llvm-svn: 71818
* Template instantiation for the NULL statement. Lame, I knowDouglas Gregor2009-05-141-0/+11
| | | | llvm-svn: 71816
* Introduce basic support for instantiating the definitions of memberDouglas Gregor2009-05-141-0/+14
functions of class templates. Only compound statements and expression statements are currently implemented. llvm-svn: 71814
OpenPOWER on IntegriCloud