summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/instantiate-init.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Improve 'failed template argument deduction' diagnostic for the case where weRichard Smith2013-01-311-1/+1
| | | | | | | | have a direct mismatch between some component of the template and some component of the argument. The diagnostic now says what the mismatch was, but doesn't yet say which part of the template doesn't match. llvm-svn: 174039
* Using CanQualType::getAs<ArrayType> is unsafe; fix the code currently using it,Eli Friedman2012-12-131-1/+1
| | | | | | and make sure additional uses don't get introduced. <rdar://problem/12858424>. llvm-svn: 170081
* PR13064: Store whether an in-class initializer uses direct or copyRichard Smith2012-06-101-2/+13
| | | | | | | initialization, and use that information to produce the right kind of initialization during template instantiation. llvm-svn: 158288
* Improve the instantiation of static data members inDouglas Gregor2011-06-031-4/+15
| | | | | | | Sema::RequireCompleteExprType() a bit more, setting the point of instantiation if needed, and skipping explicit specializations entirely. llvm-svn: 132547
* When performing template argument deduction given a function argumentDouglas Gregor2011-06-031-0/+23
| | | | | | | | | of incomplete array type, attempt to complete the array type. This was made much easier by Chandler's addition of RequireCompleteExprType(), which I've tweaked (slightly) to improve the consistency of the DeclRefExpr. Fixes PR7985. llvm-svn: 132530
* Enhance Clang to start instantiating static data member definitionsChandler Carruth2011-05-271-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | within class templates when they are necessary to complete the type of the member. The canonical example is code like: template <typename T> struct S { static const int arr[]; static const int x; static int f(); }; template <typename T> const int S<T>::arr[] = { 1, 2, 3 }; template <typename T> const int S<T>::x = sizeof(arr) / sizeof(arr[0]); template <typename T> int S<T>::f() { return x; } int x = S<int>::f(); We need to instantiate S<T>::arr's definition to pick up its initializer and complete the array type. This involves new code to specially handle completing the type of an expression where the type alone is insufficient. It also requires *updating* the expression with the newly completed type. Fortunately, all the other infrastructure is already in Clang to do the instantiation, do the completion, and prune out the unused bits of code that result from this instantiation. This addresses the initial bug in PR10001, and will be a step to fleshing out other cases where we need to work harder to complete an expression's type. Who knew we still had missing C++03 "features"? llvm-svn: 132172
* When pulling apart an initializer that involves a CXXConstructExpr, doDouglas Gregor2010-03-241-0/+18
| | | | | | | not pick apart a CXXTemporaryObjectExpr because such an object construction was explicitly written in the source code. Fixes PR6657. llvm-svn: 99427
* Use CXXTemporaryObjectExpr for explicitly-constructed temporaries. WeDouglas Gregor2010-03-021-0/+11
| | | | | | | used to do this, but it got lost when we switched functional-style cast syntax over to using the new initialization code. Fixes PR6457. llvm-svn: 97568
* 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
* Implement support for C++ direct initializers that involve dependentDouglas Gregor2009-08-261-0/+28
types or type-dependent expressions. llvm-svn: 80143
OpenPOWER on IntegriCloud