History log of /external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
ef8225444452a1486bd721f3285301fe84643b00 21-Jul-2014 Stephen Hines <srhines@google.com> Update Clang for rebase to r212749.

This also fixes a small issue with arm_neon.h not being generated always.

Includes a cherry-pick of:
r213450 - fixes mac-specific header issue
r213126 - removes a default -Bsymbolic on Android

Change-Id: I2a790a0f5d3b2aab11de596fc3a74e7cbc99081d
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
6bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89 29-May-2014 Stephen Hines <srhines@google.com> Update Clang for 3.5 rebase (r209713).

Change-Id: I8c9133b0f8f776dc915f270b60f94962e771bc83
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
651f13cea278ec967336033dd032faef0e9fc2ec 24-Apr-2014 Stephen Hines <srhines@google.com> Updated to Clang 3.5a.

Change-Id: I8127eb568f674c2e72635b639a3295381fe8af82
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
b3617be53923ac3e5885ff5001aa748bd0223102 14-Dec-2013 Bill Wendling <isanbard@gmail.com> Merging r197298:
------------------------------------------------------------------------
r197298 | rsmith | 2013-12-13 17:04:22 -0800 (Fri, 13 Dec 2013) | 3 lines

PR18232: implement instantiation for class-scope explicit specializations of
class templates (a Microsoft extension).

------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@197320 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
65173e04eacb68ff89a58fbff14979eb318896c9 28-Nov-2013 Bill Wendling <isanbard@gmail.com> Merging r195887:
------------------------------------------------------------------------
r195887 | majnemer | 2013-11-27 14:57:44 -0800 (Wed, 27 Nov 2013) | 9 lines

Sema: Instantiation of variable definitions weren't local enough

We wouldn't properly save and restore the pending local instantiations
we had built up prior to instantiation of a variable definition. This
would lead to us instantiating too much causing crashes and other
general badness.

This fixes PR14374.

------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@195901 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
57907e56191adea0fa870c052054eb0fe0c4681f 28-Nov-2013 Bill Wendling <isanbard@gmail.com> Merging r195827:
------------------------------------------------------------------------
r195827 | majnemer | 2013-11-27 00:20:38 -0800 (Wed, 27 Nov 2013) | 9 lines

Sema: Instantiate local class and their members appropriately

We would fail to instantiate them when the surrounding function was
instantiated. Instantiate the class and add it's members to the list of
pending instantiations, they should be resolved when we are finished
with the function's body.

This fixes PR9685.

------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@195900 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
e7bd89af8aa96a779c0031baf1a21e960a51d0f0 23-Oct-2013 Rafael Espindola <rafael.espindola@gmail.com> A decl never becomes unused. Make that explicit in the API.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193248 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
a3d311e468bce37defb97ed75105f8d36942b651 23-Oct-2013 Faisal Vali <faisalv@yahoo.com> And Again: Teach TreeTransform how to transform nested generic lambdas.


A previous attempt http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130930/090049.html resulted in PR 17476, and was reverted,

The original TransformLambdaExpr (pre generic-lambdas) transformed the TypeSourceInfo of the Call operator in its own instantiation scope via TransformType. This resulted in the parameters of the call operator being mapped to their transformed counterparts in an instantiation scope that would get popped off.
Then a call to TransformFunctionParameters would add the parameters and their transformed mappings (but newly created ones!) to the current instantiation scope. This would result in a disconnect between the new call operator's TSI parameters and those used to construct the call operator declaration. This was ok in the non-generic lambda world - but would cause issues with nested transformations (when non-generic and generics were interleaved) in the generic lambda world - that I somewhat kludged around initially - but this resulted in PR17476.

The new approach seems cleaner. We only do the transformation of the TypeSourceInfo - but we make sure to do it in the current instantiation scope so we don't lose the untransformed to transformed mappings of the ParmVarDecls when they get created.

Another attempt caused a test to fail (http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20131021/091533.html) and also had to be reverted - my apologies - in my haste, i did not run all the tests - argh!

Now all the tests seem to pass - but a Fixme has been added - since I suspect Richard will find the fix a little inelegant ;) I shall try and work on a more elegant fix once I have had a chance to discuss with Richard or Doug at a later date.

Hopefully the third time;s a charm *fingers crossed*

This does not yet include capturing.

Please see test file for examples.

This patch was LGTM'd by Doug:
http://llvm-reviews.chandlerc.com/D1784



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193230 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
80f2b2e693422f84ec3735f16a08614a527b0bc5 23-Oct-2013 Rafael Espindola <rafael.espindola@gmail.com> Revert r193223 and r193216.

They were causing CodeGenCXX/mangle-exprs.cpp to fail.

Revert "Remove the circular reference to LambdaExpr in CXXRecordDecl."

Revert "Again: Teach TreeTransform and family how to transform generic lambdas nested within templates and themselves."

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193226 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
f06a2893bc9778857295c64ee32b4a899a338480 23-Oct-2013 Richard Smith <richard-llvm@metafoo.co.uk> Make UsingShadowDecls redeclarable. This fixes some visibility problems with
modules.

With this fixed, I no longer see any test regressions in the libc++ test suite
when enabling a single-module module.map for libc++ (other than issues with my
system headers).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193219 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
b814a2ac581f7aa31aeef1abb8567ea123a13519 23-Oct-2013 Faisal Vali <faisalv@yahoo.com> Again: Teach TreeTransform and family how to transform generic
lambdas nested within templates and themselves.

A previous attempt http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130930/090049.html resulted in PR 17476, and was reverted,


The original TransformLambdaExpr (pre generic-lambdas) transformed the TypeSourceInfo of the Call operator in its own instantiation scope via TransformType. This resulted in the parameters of the call operator being mapped to their transformed counterparts in an instantiation scope that would get popped off.
Then a call to TransformFunctionParameters would add the parameters and their transformed mappings (but newly created ones!) to the current instantiation scope. This would result in a disconnect between the new call operator's TSI parameters and those used to construct the call operator declaration. This was ok in the non-generic lambda world - but would cause issues with nested transformations (when non-generic and generics were interleaved) in the generic lambda world - that I somewhat kludged around initially - but this resulted in PR17476.

The new approach seems cleaner. We only do the transformation of the TypeSourceInfo - but we make sure to do it in the current instantiation scope so we don't lose the untransformed to transformed mappings of the ParmVarDecls when they get created.

This does not yet include capturing.

Please see test file for examples.

This patch was LGTM'd by Doug:
http://llvm-reviews.chandlerc.com/D1784


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193216 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
bc6509175e1ce5cc1b48d1b97ac8d23d8b74167c 17-Oct-2013 Rafael Espindola <rafael.espindola@gmail.com> Rename some functions for consistency.

Every other function in Redeclarable.h was using Decl instead of Declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192900 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
d69f37b5822420e3c3a1b2e875b122aca8248533 08-Oct-2013 Alp Toker <alp@nuanti.com> Make InstantiatingTemplate depth checks clearer

The bool conversion operator on InstantiatingTemplate never added value and
only served to obfuscate the template instantiation routines.

This replaces the conversion and its callers with an explicit isInvalid()
function to make it clear what's going on at a glance.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192177 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
f003acd8e7bdb994743dc8ea64f90db5360a8b4a 04-Oct-2013 Rafael Espindola <rafael.espindola@gmail.com> Revert "Teach TreeTransform and family how to transform generic lambdas within templates and nested within themselves."

This reverts commit r191879. It caused llvm.org/pr17476.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191955 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
618c28547a7f7cc785a6c6301f79febf5a584f9e 03-Oct-2013 Faisal Vali <faisalv@yahoo.com> Teach TreeTransform and family how to transform generic lambdas within templates and nested within themselves.

This does not yet include capturing (that is next).

Please see test file for examples.

This patch was LGTM'd by Doug:
http://llvm-reviews.chandlerc.com/D1784
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130930/090048.html

When I first committed this patch - a bunch of buildbots were unable to compile the code that VS2010 seemed to compile. Seems like there was a dependency on Sema/Template.h which VS did not seem to need, but I have now added for the other compilers. It still compiles on Visual Studio 2010 - lets hope the buildbots remain quiet (please!)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191879 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
9683f1de5f8eb3a4dd7c7fcb4ff58033b9cfa46f 03-Oct-2013 Faisal Vali <faisalv@yahoo.com> Revert changes from the nested lambdas commit till i figure out
why the buildbots are failing.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191876 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
aecbb9de3bed4372695756f18af2c1304a81e7c4 03-Oct-2013 Faisal Vali <faisalv@yahoo.com> Teach TreeTransform and family how to transform generic lambdas within templates and nested within themselves.

This does not yet include capturing (that is next).

Please see test file for examples.

This patch was LGTM'd by Doug:
http://llvm-reviews.chandlerc.com/D1784


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191875 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
2e563c28c456b48f43f38f5a92a4bc292d5cda91 30-Sep-2013 Manuel Klimek <klimek@google.com> Fix use-after-free.

TemplateDeclInstantiator takes the MultiLevelArgumentList by const-ref
and stores a const-ref member. Thus, we must not pass a temporary
into the constructor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191665 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
04fa7a33279808dc3e5117c41b5f84c40eeb7362 28-Sep-2013 Richard Smith <richard-llvm@metafoo.co.uk> Per latest drafting, switch to implementing init-captures as if by declaring
and capturing a variable declaration, and complete the implementation of them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191605 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
d0629eb137d06bf6d46a430abdb7fa044909298b 27-Sep-2013 Richard Smith <richard-llvm@metafoo.co.uk> Variable templates: handle instantiation of static data member templates
appropriately, especially when they appear within class templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191548 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
e688ddf351d5d77d18cd01727e672e4b69706b23 26-Sep-2013 Richard Smith <richard-llvm@metafoo.co.uk> If a partial specialization of a member template is declared within a class
template and defined outside it, don't instantiate it twice when instantiating
the surrounding class template specialization. That would cause us to reject
the code because we think two partial specializations instantiated to produce
the same signature.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191418 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
90618ff0b53f063a880c4933d44c70d6c1cb8dc0 24-Sep-2013 Richard Smith <richard-llvm@metafoo.co.uk> Revert change accidentally committed in r191150.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191237 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
b390e49da4f140fab12732a1c99f4074f5f351a2 21-Sep-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR17295: Do not allow explicit conversion functions to be used in cases where
an additional conversion (other than a qualification conversion) would be
required after the explicit conversion.

Conversely, do allow explicit conversion functions to be used when initializing
a temporary for a reference binding in direct-list-initialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191150 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
a41c97a5d1912ffd184381d269fd8e5a25ee5e59 20-Sep-2013 Richard Smith <richard-llvm@metafoo.co.uk> Switch the semantic DeclContext for a block-scope declaration of a function or
variable from being the function to being the enclosing namespace scope (in
C++) or the TU (in C). This allows us to fix a selection of related issues
where we would build incorrect redeclaration chains for such declarations, and
fail to notice type mismatches.

Such declarations are put into a new IdentifierNamespace, IDNS_LocalExtern,
which is only found when searching scopes, and not found when searching
DeclContexts. Such a declaration is only made visible in its DeclContext if
there are no non-LocalExtern declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191064 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
aa82461f696ced36b0cd817dfa492b6c93d15447 18-Sep-2013 David Majnemer <david.majnemer@gmail.com> Revert "Revert "[-cxx-abi microsoft] Mangle local TagDecls appropriately""

This reverts commit r190895 which reverted r190892.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190904 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
1f7fd68131872707a297335e6bc71beef47f9d73 18-Sep-2013 David Majnemer <david.majnemer@gmail.com> Revert "[-cxx-abi microsoft] Mangle local TagDecls appropriately"

This reverts commit r190892.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190895 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
075404782734005e4742621ba4fa29e334cd4987 18-Sep-2013 David Majnemer <david.majnemer@gmail.com> [-cxx-abi microsoft] Mangle local TagDecls appropriately

Summary:
When selecting a mangling for an anonymous tag type:
- We should first try it's typedef'd name.
- If that doesn't work, we should mangle in the name of the declarator
that specified it as a declaration specifier.
- If that doesn't work, fall back to a static mangling of
<unnamed-type>.

This should make our anonymous type mangling compatible.

This partially fixes PR16994; we would need to have an implementation of
scope numbering to get it right (a separate issue).

Reviewers: rnk, rsmith, rjmccall, cdavis5x

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1540

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190892 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
86164e8f51fa89a3ec904607c3848dc4a21b12cf 05-Sep-2013 Eli Friedman <eli.friedman@gmail.com> Note when a decl is used in AST files.

When an AST file is built based on another AST file, it can use a decl from
the fist file, and therefore mark the "isUsed" bit. We need to note this in
the AST file so that the bit is set correctly when the second AST file is
loaded.

This patch introduces the distinction between setIsUsed() and markUsed() so
that we don't call into the ASTMutationListener callback when it wouldn't
be appropriate.

Fixes PR16635.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190016 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
9d57b8dea3b139dc2e2976ffccef50c74ac03873 29-Aug-2013 David Majnemer <david.majnemer@gmail.com> Sema: Subst type default template args earlier

Summary:
We would not perform substitution at an appropriate point, allowing strange
results to appear. We would accepts things that we shouldn't or mangle things incorrectly. Note that this hasn't fixed the other cases like
template-template parameters or non-type template parameters.

Reviewers: doug.gregor, rjmccall, rsmith

Reviewed By: rsmith

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1507

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189540 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
37fd27dbb941d27f4bd7412e534e7e5089d6781b 23-Aug-2013 Richard Smith <richard-llvm@metafoo.co.uk> Remove SequenceNumber from class/variable template partial specializations.
This was only used to ensure that the traversal order was the same as the
insertion order, but that guarantee was already being provided by the use
of a FoldingSetVector.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189075 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
567f917df048d42732997a479b2b257403fc88ef 22-Aug-2013 Larisse Voufo <lvoufo@google.com> Refactor for clarity and simplicity.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188974 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
04592e7c1260a6a671a24d91dab16f5d5a024fe0 22-Aug-2013 Larisse Voufo <lvoufo@google.com> Improve support for static data member templates. This revision still has at least one bug, as it does not respect the variable template specialization hierarchy well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188969 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
360d23ef628bf891514e77c519d1d77305ca1743 16-Aug-2013 David Majnemer <david.majnemer@gmail.com> Parse: Do not 'HandleTopLevelDecl' on templated functions.

Summary:
HandleTopLevelDecl on a templated function leads us to try and mangle
it.

Reviewers: rsmith

Reviewed By: rsmith

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1412

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188536 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
37e849ad80731ac1b2ad1c64e73bced27802bd8b 14-Aug-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR16875: The return type of a dependent function type is visible when it's
referenced as a member of the current instantiation. In that case, deduce the
type of the function to a dependent type rather than exposing an undeduced auto
type to the rest of the current instantiation.

The standard doesn't really say that the type is dependent in this case; I'll
bring this up with CWG.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188410 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
4a91989b2dc901a4998fa5443aeba0276a8cfaa6 14-Aug-2013 Larisse Voufo <lvoufo@google.com> Bug fix: disallow a variable template to be redeclared as a non-templated variable

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188350 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
dd9459f8869f66409f7ea429053b453e33f6499c 13-Aug-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix implementation of C11 6.2.7/4 and C++11 [dcl.array]p3:

When a local extern declaration redeclares some other entity, the type of that
entity is merged with the prior type if the prior declaration is visible (in C)
or is declared in the same scope (in C++).

- Make LookupRedeclarationWithLinkage actually work in C++, use it in the right
set of cases, and make it track whether it found a shadowed declaration.
- Track whether we found a declaration in the same scope (for C++) including
across serialization and template instantiation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188307 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
439d665f4d1066ee5ebd8dd0938d85be83d490c4 13-Aug-2013 Larisse Voufo <lvoufo@google.com> variable templates updated for PCH serialization... Still working on test cases...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188249 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
29a46e63490176608efe13f13b293a6ce9862059 10-Aug-2013 Serge Pavlov <sepavloff@gmail.com> Fix to PR16225 (Assert-on-invalid: isa<LabelDecl>(D) && "declaration not instantiated in this scope")

Differential Revision: http://llvm-reviews.chandlerc.com/D920


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188137 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
c1cef0892e049fcd31084f02d1efdd9985d4dfa4 10-Aug-2013 Enea Zaffanella <zaffanella@cs.unipr.it> Added source locs for angled parentheses in class/var template partial specs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188134 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
ac32d9044b9c1e7492cef929a322d23ce899d276 07-Aug-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR9992: Serialize and deserialize the token sequence for a function template in
-fdelayed-template-parsing mode. Patch by Will Wilson!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187916 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
3151b7c6dd49947b0a91b3e22c31f4864629e355 06-Aug-2013 Larisse Voufo <lvoufo@google.com> Fixing commit r187768: Moved diagnosis of forward declarations of variable templates from Parser to Sema.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187770 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
06935f32645c8965e398bbd141f9800eacdfd439 06-Aug-2013 Larisse Voufo <lvoufo@google.com> Moved diagnosis of forward declarations of variable templates from Parser to Sema.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187768 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
cec70f57925903c22937a7c9d3933d551a583566 06-Aug-2013 NAKAMURA Takumi <geek4civic@gmail.com> SemaTemplateInstantiateDecl.cpp: Suppress a warning. [-Wunused-variable]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187765 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
ef4579cda09b73e3d4d98af48201da25adc29326 06-Aug-2013 Larisse Voufo <lvoufo@google.com> Started implementing variable templates. Top level declarations should be fully supported, up to some limitations documented as FIXMEs or TODO. Static data member templates work very partially. Static data member templates of class templates need particular attention...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187762 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
c66e7e99d5acc560de5cea50909fcea22ef12ca5 31-Jul-2013 Reid Kleckner <reid@kleckner.net> Fix declaring class template methods with an attributed typedef

This change unifies the logic for template instantiation of methods and
functions declared with typedefs.

It ensures that SubstFunctionType() always fills the Params out param
with non-null ParmVarDecls or returns null.

Reviewers: rsmith

Differential Revision: http://llvm-reviews.chandlerc.com/D1135

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187528 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
8d030c7a6f36438f6c7dd977f8be0de0cc781ad5 22-Jul-2013 Enea Zaffanella <zaffanella@cs.unipr.it> Improve clarity/consistency of a few UsingDecl methods and related helpers.
No functionality change.

In Sema helper functions:
* renamed isTypeName as HasTypenameKeyword
In UsingDecl:
* renamed get/setUsingLocation to get/setUsingLoc
* renamed is/setTypeName as has/setTypename



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186816 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
de9ed71c696bee936a21323f61548164de0eda13 19-Jul-2013 Enea Zaffanella <zaffanella@cs.unipr.it> Fix source range of implicitly instantiated friend declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186702 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
22050f25e34ba0cd21ee2dc3d765951c48e27cde 18-Jul-2013 Richard Smith <richard-llvm@metafoo.co.uk> Reinstate r186040, with additional fixes and more test coverage (reverted in
r186331).

Original commit log:
If we friend a declaration twice, that should not make it visible to
name lookup in the surrounding context. Slightly rework how we handle
friend declarations to inherit the visibility of the prior
declaration, rather than setting a friend declaration to be visible
whenever there was a prior declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186546 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
52c2575fc77a51f36129be89d1a0a90e31617a57 15-Jul-2013 Chandler Carruth <chandlerc@gmail.com> Re-revert r86040, which was un-reverted in r186199.

This breaks the build of basic patterns with repeated friend
declarations. See the added test case in SemaCXX/friend.cpp or the test
case reported to the original commit log.

Original commit log:
If we friend a declaration twice, that should not make it visible to
name lookup in the surrounding context. Slightly rework how we handle
friend declarations to inherit the visibility of the prior
declaration, rather than setting a friend declaration to be visible
whenever there was a prior declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186331 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
dc49d523db70a1c9005b7c09de80b22ccb1ed6a4 15-Jul-2013 Serge Pavlov <sepavloff@gmail.com> Fix to PR12262 - assertion when substituting explicit template arguments
does not substitute a sizeof-pack expression.
The solution is proposed by Richard Smith.
Differential Revision: http://llvm-reviews.chandlerc.com/D869


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186306 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
f9e65a274d4e5c5a45503efc81da43be76503983 12-Jul-2013 Richard Smith <richard-llvm@metafoo.co.uk> Unrevert r186040, reverted in r186185, with fix for PR16597.

Original commit log:
If we friend a declaration twice, that should not make it visible to
name lookup in the surrounding context. Slightly rework how we handle
friend declarations to inherit the visibility of the prior
declaration, rather than setting a friend declaration to be visible
whenever there was a prior declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186199 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
1afa611e36e0ab23dd3cde4bbe5aa74ceb7d77c5 12-Jul-2013 Chandler Carruth <chandlerc@gmail.com> Revert r186040 to fix PR16597 while Richard investigates what the best
fix is.

Original commit log:
If we friend a declaration twice, that should not make it visible to
name lookup in the surrounding context. Slightly rework how we handle
friend declarations to inherit the visibility of the prior
declaration, rather than setting a friend declaration to be visible
whenever there was a prior declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186185 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
433a13d0cdb1c48b828fe5bfb6a835c58e1e758b 11-Jul-2013 Richard Smith <richard-llvm@metafoo.co.uk> If we friend a declaration twice, that should not make it visible to name
lookup in the surrounding context. Slightly rework how we handle friend
declarations to inherit the visibility of the prior declaration, rather
than setting a friend declaration to be visible whenever there was a prior
declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186040 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
041d10caff48859c0de6d001559a73185f5e0601 10-Jul-2013 Serge Pavlov <sepavloff@gmail.com> Fixed comment of Sema::FindInstantiatedDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185997 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
ded9979a2997336cee8797deb6bb3194fccc2068 28-Jun-2013 Eli Friedman <eli.friedman@gmail.com> Switch Decl instantiation to DeclNodes.inc.

This replaces a long list of declarations for visitor functions with
a list generated from DeclNodes.inc. Nothing really interesting came
out of it; we had comprehensive coverage anyway
(excluding FriendTemplateDecls).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185118 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
86648b13eb01c0565de7264b27799ba81c7ad060 26-Jun-2013 Faisal Vali <faisalv@yahoo.com> Fix PCH bug with member templates of local classes in nontemplate functions.

As noted by Richard in the post:
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130624/082605.html, the following code should not add an entry
into PendingLocalImplicitInstantiations, since local instantiations
should only occur within the context of other instantiations:

int foo(double y) {
struct Lambda {
template<class T> T operator()(T t) const { return t; };
} lambda;
return lambda(y);
}

Hence the attached code does the following:
1) In MarkFunctionReferenced, check if ActiveInstantiations.size()
is non-zero before adding to PendingLocalImplicitInstantiations.
2) In InstantiateFunctionDefinition, we swap out/in
PendingLocalImplicitInstantiations so that only those
pending local instantiations that are added during the instantiation
of the current function are instantiated recursively.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184903 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
98a75581e155a7dac853a69b0151960f8e2aacbd 13-Jun-2013 Nick Lewycky <nicholas@mxc.ca> Include the unexpanded packs in the initializer expression when checking a
pack expanded constructor initializer list. Fixes PR16303!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183878 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
0567a79130a251bf464ce21ecf3f8b9fb5207900 10-Jun-2013 Reid Kleckner <reid@kleckner.net> Use FPT::getArgTypes() instead of manually building ArrayRefs

Made significantly easier with git-clang-format.

Differential Revision: http://llvm-reviews.chandlerc.com/D947

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183694 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
50b60b35a9377bb621f21955b956b581f9860baf 10-Jun-2013 Larisse Voufo <lvoufo@google.com> reverted test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183637 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
817e01f509649b7fb1b879412f9c99766af6315f 10-Jun-2013 Larisse Voufo <lvoufo@google.com> test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183636 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
cafeb948e6067b8dc897c441da522367917b06f9 07-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR16243: Use CXXThisOverride during template instantiation, and fix up the
places which weren't setting it up properly. This allows us to get the right
cv-qualifiers for 'this' when it appears outside a method body in a class
template.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183483 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
b5eb3f5bf383807103dc1377a124fd96ee21d02a 17-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR15757: When we instantiate an inheriting constructor template, also
instantiate the inherited constructor template and mark that as the constructor
which the instantiated specialization is inheriting. This fixes a
crash-on-valid when trying to compute the exception specification of a
specialization of the inheriting constructor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182072 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
6af701f29be43e49a25ab098c79940ae4cbb69c7 13-May-2013 Alexey Bataev <a.bataev@hotmail.com> OpenMP threadprivate with qualified names.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181683 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
dc17384581e37436582a007be4d9185bcf7003ec 04-May-2013 Enea Zaffanella <zaffanella@cs.unipr.it> In VarDecl nodes, store the thread storage class specifier as written.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181113 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
60e141e1f87211ca831de6821003d80fe20a06f3 04-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> Implement most of N3638 (return type deduction for normal functions).
Missing (somewhat ironically) is support for the new deduction rules
in lambda functions, plus PCH support for return type patching.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181108 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
c95d413660756c474bc8f97e5b32edc7ddff3850 04-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> ArrayRef'ize MultiLevelTemplateArgumentList::ArgList. Patch by Faisal Vali!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181077 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
9ff2b421f352fe0a0769c0a2a75af922c147b878 27-Apr-2013 Dmitri Gribenko <gribozavr@gmail.com> ArrayRef'ize Sema::ActOnEnumBody. No functionality change.

Patch by Robert Wilhelm.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180682 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
76da55d3a49e1805f51b1ced7c5da5bcd7f759d8 16-Apr-2013 John McCall <rjmccall@apple.com> Basic support for Microsoft property declarations and
references thereto.

Patch by Tong Shen!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179585 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
459ef03126f9f0420efb3355e3b2ed3c1fdfb38a 16-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Correctly propagate the storage class to function template instantiations.

This fixes pr15753. This is another case of the fuzzy definition of the
"as written" storage class of an instantiation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179581 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
72fdc8947e54be1a8dd36b03e24f112aba1241e1 15-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Fix the storage class of method instantiations.

We keep the "as written" storage class, but that is a fuzzy concept for
instantiations. With this patch instantiations of methods of class templates
now get a storage class that is based on the semantics of isStatic(). With this
can simplify isStatic() itself.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179521 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
38afbc7361d861968232defaeaf8e302af75b5ee 13-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> Annotate flavor of TLS variable (statically or dynamically initialized) onto the AST.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179447 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
4841ca5f83bf970f910ac7d154cdd71d2a3cf481 10-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> C++11 inheriting constructors: support for inheriting constructor templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179151 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
d2615cc53b916e8aae45783ca7113b93de515ce3 03-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Add 178663 back.

http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb went back green
before it processed the reverted 178663, so it could not have been the culprit.

Revert "Revert 178663."

This reverts commit 4f8a3eb2ce5d4ba422483439e20c8cbb4d953a41.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178682 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
4f8a3eb2ce5d4ba422483439e20c8cbb4d953a41 03-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Revert 178663.

Looks like it broke http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb

Revert "Don't compute a patched/semantic storage class."

This reverts commit 8f187f62cb0487d31bc4afdfcd47e11fe9a51d05.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178681 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
8f187f62cb0487d31bc4afdfcd47e11fe9a51d05 03-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Don't compute a patched/semantic storage class.

For variables and functions clang used to store two storage classes. The one
"as written" in the code and a patched one, which, for example, propagates
static to the following decls.

This apparently is from the days clang lacked linkage computation. It is now
redundant and this patch removes it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178663 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
c640058aa7f224a71ce3b1d2601d84e1b57f82d3 22-Mar-2013 Alexey Bataev <a.bataev@hotmail.com> OpenMP threadprivate directive parsing and semantic analysis

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177705 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
83972f128e9218c051692bf96361327a701aeb79 09-Mar-2013 John McCall <rjmccall@apple.com> Add TagDecl::hasNameForLinkage(), which is true if the tag
is non-anonymous or is defined in a typedef of itself.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176742 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
c61361b102fcb9be7b64cc493fb797ea551eb8e7 08-Mar-2013 Douglas Gregor <dgregor@apple.com> <rdar://problem/13094134> Don't try to wire up typedef names for invalid anonymous tag declarations encountered during template instantiation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176727 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
bea522ff43a3f11c7a2bc7949119dbb9fce19e39 08-Mar-2013 Jordan Rose <jordan_rose@apple.com> ArrayRef-ize ASTContext::getFunctionType and Sema::BuildFunctionType.

No (intended) functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176726 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
afda905e60151f0bc34c187d51a798b4265f69af 24-Feb-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> In Sema::InstantiateStaticDataMemberDefinition, pass the var decl to the consumer
just using ASTConsumer::HandleCXXStaticMemberVarInstantiation(), don't pass it with
ASTConsumer::HandleTopLevelDecl.

ASTConsumer::HandleTopLevelDecl is intended for user-written top-level decls;
a consumer can treat an instantiated static data member however it wants of course.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175976 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
f6565a9f7318b1ca6ea9510003dde7b89696daab 22-Feb-2013 Richard Smith <richard-llvm@metafoo.co.uk> Handle alignas(foo...) pack expansions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175875 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
671b3219c2be00ef8f26234ec993816c3ba56a4f 22-Feb-2013 Richard Smith <richard-llvm@metafoo.co.uk> Implement C++11 [dcl.align]p6-p8, and C11 6.7.5/7. This had to be split out of
the normal attribute-merging path, because we can't merge alignment attributes
without knowing the complete set of alignment attributes which apply to a
particular declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175861 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
66874fb18afbffb8b2ca05576851a64534be3352 21-Feb-2013 David Blaikie <dblaikie@gmail.com> Use None rather than Optional<T>() where possible.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175705 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
dc84cd5efdd3430efb22546b4ac656aa0540b210 20-Feb-2013 David Blaikie <dblaikie@gmail.com> Include llvm::Optional in clang/Basic/LLVM.h

Post-commit CR feedback from Jordan Rose regarding r175594.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175679 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
39e6ab4be93d9c5e729a578ddd9d415cd2d49872 18-Feb-2013 David Blaikie <dblaikie@gmail.com> Replace TypeLoc llvm::cast support to be well-defined.

The TypeLoc hierarchy used the llvm::cast machinery to perform undefined
behavior by casting pointers/references to TypeLoc objects to derived types
and then using the derived copy constructors (or even returning pointers to
derived types that actually point to the original TypeLoc object).

Some context is in this thread:
http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-December/056804.html
Though it's spread over a few months which can be hard to read in the mail
archive.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175462 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
be507b6e72df8ab5e7d8c31eb4453e1bdf5fcfaf 01-Feb-2013 Richard Smith <richard-llvm@metafoo.co.uk> Implement [dcl.align]p5 and C11 6.7.5/4: alignas cannot underalign.
Also support alignas(0), which C++11 and C11 require us to ignore.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174157 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
a31f65b10e61ca8f2f427b1df176c10ea8a0efa2 01-Feb-2013 Michael Han <fragmentshaders@gmail.com> [Sema][Attr]Fix alignment attribute printing.

Remove "IsMSDeclspec" argument from Align attribute since the arguments in Attr.td should
only model those appear in source code. Introduce attribute Accessor, and teach TableGen
to generate syntax kind accessors for Align attribute, and use those accessors to decide
if an alignment attribute is a declspec attribute.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174133 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
8f3aacc8c4849c9e0e7a236954725fffdeb917a6 29-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> Propagate the spelling list index for an attribute across template instantiation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173768 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
d4497dde6fc8f5ce79e0ec37682b8dc920bbbef0 25-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> Clean up: since we have FunctionDecl::IsInline, make it store the right value
for template instantiations, and use it to simplify the implementation of
FunctionDecl::isInlined().

This incidentally changes the result of isInlined on a declared-but-not-defined
non-inline member function from true to false. This is sort of a bug fix, but
currently isInlined is only called on function definitions, so it has no visible
effects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173397 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
93c8617bec98aeb769ee9f569d7ed439eec03249 17-Jan-2013 David Blaikie <dblaikie@gmail.com> ArrayRef-ize some ctor initializer related APIs

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172701 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
80ad52f327b532bded5c5b0ee38779d841c6cd35 02-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> s/CPlusPlus0x/CPlusPlus11/g


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171367 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
c83c2300e1946fea78ecd3c2e93d9c2dd2638a2b 19-Dec-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR13470: Ensure that copy-list-initialization isntantiates as
copy-list-initialization (and doesn't add an additional copy step):

Fill in the ListInitialization bit when creating a CXXConstructExpr. Use it
when instantiating initializers in order to correctly handle instantiation of
copy-list-initialization. Teach TreeTransform that function arguments are
initializations, and so need this special treatment too. Finally, remove some
hacks which were working around SubstInitializer's shortcomings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170489 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
3bc93e3124ad5e7191c4a12dc981c8ee53578193 19-Dec-2012 David Blaikie <dblaikie@gmail.com> Change DeclContextLookup(Const)Result to (Mutable)ArrayRef<NamedDecl*>, as per review discussion in r170365

This does limit these typedefs to being sequences, but no current usage
requires them to be contiguous (we could expand this to a more general
iterator pair range concept at some point).

Also, it'd be nice if SmallVector were constructible directly from an ArrayRef
but this is a bit tricky since ArrayRef depends on SmallVectorBaseImpl for the
inverse conversion. (& generalizing over all range-like things, while nice,
would require some nontrivial SFINAE I haven't thought about yet)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170482 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
1d28caf3b5254e60d3e3a1d2d37e5df2e5924111 11-Dec-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR14558: Compute triviality of special members (etc) at the end of the class
definition, rather than at the end of the definition of the set of nested
classes. We still defer checking of the user-specified exception specification
to the end of the nesting -- we can't check that until we've parsed the
in-class initializers for non-static data members.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169805 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
ac71351acdefc9de0c770c1d717e621ac9e684bf 08-Dec-2012 Richard Smith <richard-llvm@metafoo.co.uk> Properly compute triviality for explicitly-defaulted or deleted special members.
Remove pre-standard restriction on explicitly-defaulted copy constructors with
'incorrect' parameter types, and instead just make those special members
non-trivial as the standard requires.

This required making CXXRecordDecl correctly handle classes which have both a
trivial and a non-trivial special member of the same kind.

This also fixes PR13217 by reimplementing DiagnoseNontrivial in terms of the
new triviality computation technology.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169667 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
55fc873017f10f6f566b182b70f6fc22aefa3464 04-Dec-2012 Chandler Carruth <chandlerc@gmail.com> Sort all of Clang's files under 'lib', and fix up the broken headers
uncovered.

This required manually correcting all of the incorrect main-module
headers I could find, and running the new llvm/utils/sort_includes.py
script over the files.

I also manually added quite a few missing headers that were uncovered by
shuffling the order or moving headers up to be main-module-headers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169237 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
4a9e60fc7c36e323ae376601cc704fed4beb68ae 16-Nov-2012 Nick Lewycky <nicholas@mxc.ca> Store this Decl* as a Decl* instead of a uintptr_t. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168145 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
accaf19bc1129c0273ec50dba52318e60bc29103 14-Nov-2012 Benjamin Kramer <benny.kra@googlemail.com> s/tranform/transform/

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167929 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
b5b37d194dddb960f43f763b3f9c3e17e7be3c2d 23-Oct-2012 Richard Smith <richard-llvm@metafoo.co.uk> Ugly ugly hack for libstdc++-4.6 and libstdc++-4.7 compatibility. These
libraries have an incorrect definition of std::common_type (inherited from a
bug in the standard -- see LWG issue 2141), whereby they produce reference
types when they should not.

If we instantiate a typedef named std::common_type<...>::type, which is defined
in a system header as decltype(... ? ... : ...), and the decltype produces a
reference type, convert it to the non-reference type. (This doesn't affect any
LWG2141-conforming implementation of common_type, such as libc++'s, because the
default implementation of common_type<...>::type isn't supposed to produce a
reference type.)

This is horrible. I'm really sorry. :( Better ideas appreciated!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166455 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
635311f94e8fd4ff153130d91046ff78ffe97b06 04-Oct-2012 Abramo Bagnara <abramo.bagnara@bugseng.com> Fixed instantiated operators source range.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165258 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
54b3ba8cf2eb4886a88cdb8adedb15f43333ff1d 25-Sep-2012 Richard Smith <richard-llvm@metafoo.co.uk> Don't produce diagnostics for missing ctor-initializers during template
instantiations if we encountered errors parsing some of the initializers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164578 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
d6f80daa84164ceeb8900da07f43b6a150edf713 20-Sep-2012 Richard Smith <richard-llvm@metafoo.co.uk> Per C++11 [class.friend]p3, the 'friend' keyword must appear first in a
non-function friend declaration. Patch by Josh Magee!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164273 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
bed51fef5773f043db2ad13aa2b6d2f8a8bdbdba 14-Sep-2012 Douglas Gregor <dgregor@apple.com> Actually rebuild function types properly when adjusting the function
type of an instantiation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163848 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
71074fdf40a8f5b53810712102b58c27efc30759 13-Sep-2012 Douglas Gregor <dgregor@apple.com> When we substitute into the type of a function based on the
TypeSourceInfo, we may have lost some adjustments made to the type of
that function due to declaration merging. Adjust the resulting type
correspondingly. Fixes PR12948 / <rdar://problem/11552434>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163845 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
9a4db032ecd991626d236a502e770126db32bd31 12-Sep-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR13811: Add a FunctionParmPackExpr node to handle references to function
parameter packs where the reference is not being expanded but the pack has
been. Previously, Clang would segfault in such cases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163672 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
6964b3f80ce1ba489e7e25e7cd58062699af9b0c 07-Sep-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR9023: A template template parameter whose template parameter list contains an
unexpanded parameter pack is a pack expansion. Thus, as with a non-type template
parameter which is a pack expansion, it needs to be expanded early into a fixed
list of template parameters.

Since the expanded list of template parameters is not itself a parameter pack,
it is permitted to appear before the end of the template parameter list, so also
remove that restriction (for both template template parameter pack expansions and
non-type template parameter pack expansions).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163369 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
536afbeb5609db87d98da8402ed0fd58f61f5d3a 05-Sep-2012 Abramo Bagnara <abramo.bagnara@gmail.com> Do not add using directives to a function decl context when instantiating.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163208 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
4e28d9e2ba9ce237549b45cfd4136ec6536d1325 24-Aug-2012 Benjamin Kramer <benny.kra@googlemail.com> Remove ASTOwningVector, it doesn't own anything and provides no value over SmallVector.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162492 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
3fe198bf0d6118c7b080c17c3bb28d7c84e458b9 23-Aug-2012 Benjamin Kramer <benny.kra@googlemail.com> Rip out remnants of move semantic emulation and smart pointers in Sema.

These were nops for quite a while and only lead to confusion. ASTMultiPtr
now behaves like a proper dumb array reference.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162475 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
1f2e1a96bec2ba6418ae7f2d2b525a3575203b6a 10-Aug-2012 John McCall <rjmccall@apple.com> Check access to friend declarations. There's a number of different
things going on here that were problematic:
- We were missing the actual access check, or rather, it was suppressed
on account of being a redeclaration lookup.
- The access check would naturally happen during delay, which isn't
appropriate in this case.
- We weren't actually emitting dependent diagnostics associated with
class templates, which was unfortunate.
- Access was being propagated incorrectly for friend method declarations
that couldn't be matched at parse-time.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161652 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
b9d0b76e42fd2d4cdfd135220302458d03ad09fe 27-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> Final piece of core issue 1330: delay computing the exception specification of
a defaulted special member function until the exception specification is needed
(using the same criteria used for the delayed instantiation of exception
specifications for function temploids).

EST_Delayed is now EST_Unevaluated (using 1330's terminology), and, like
EST_Uninstantiated, carries a pointer to the FunctionDecl which will be used to
resolve the exception specification.

This is enabled for all C++ modes: it's a little faster in the case where the
exception specification isn't used, allows our C++11-in-C++98 extensions to
work, and is still correct for C++98, since in that mode the computation of the
exception specification can't fail.

The diagnostics here aren't great (in particular, we should include implicit
evaluation of exception specifications for defaulted special members in the
template instantiation backtraces), but they're not much worse than before.

Our approach to the problem of cycles between in-class initializers and the
exception specification for a defaulted default constructor is modified a
little by this change -- we now reject any odr-use of a defaulted default
constructor if that constructor uses an in-class initializer and the use is in
an in-class initialzer which is declared lexically earlier. This is a closer
approximation to the current draft solution in core issue 1351, but isn't an
exact match (but the current draft wording isn't reasonable, so that's to be
expected).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160847 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
adb1d4c18ee83249d4cffc99ef902f98e846092a 23-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR12917: Remove incorrect assumption that lambda mangling information cannot
change once it's been assigned. It can change in two ways:
1) In a template instantiation, the context declaration should be the
instantiated declaration, not the declaration in the template.
2) If a lambda appears in the pattern of a variadic pack expansion, the
mangling number will depend on the pack length.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160614 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
500d729e85028944355a119f9823ac99fa5ddcab 18-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR13386: When matching up parameters between a function template declaration
and a function template instantiation, if there's a parameter pack in the
declaration and one at the same place in the instantiation, don't assume that
the pack wasn't expanded -- it may have expanded to nothing. Instead, go ahead
and check whether the parameter pack was expandable. We can do this as a
side-effect of the work we'd need to do anyway, to find how many parameters
were produced.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160416 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
85f485a70fbec54c9b4562dfc4d95188ea6c9b48 16-Jul-2012 David Blaikie <dblaikie@gmail.com> Fix rejects-valid: explicit specialization of redeclared deleted function template.

Review by Richard Smith.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160306 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
e3f470a718ec00eb8b546e405fa59bc2df2d7c46 12-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> Stop instantiating a class if we hit a static_assert failure. Also, if the
static_assert fails when parsing the template, don't diagnose it again on every
instantiation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160088 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
ab91ef1dbe524bba3c0147b11dfdd394153c783d 08-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR9793: Treat substitution as an instantiation step for the purpose of the
-ftemplate-depth limit. There are various ways to get an infinite (or merely
huge) stack of substitutions with no intervening instantiations. This is also
consistent with gcc's behavior.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159907 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
6b02009359a462ffe633696a4441313b462e6566 25-Jun-2012 Nico Weber <nicolasweber@gmx.de> Make explicit specializations at class scope work
for non-type template parameters in microsoft mode.
PR12709.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159147 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
fc685ace387734599c475426b1a8efdb491054b8 20-Jun-2012 Aaron Ballman <aaron@aaronballman.com> Reapplying the changes from r158717 as they were rolled back to avoid merge conflicts from a separate problematic patch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158750 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
3532936f4f50c15fcec4d00f4cbb81a7a9dd9b7e 19-Jun-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Revert r158700 and dependent patches r158716, r158717, and r158731.

The original r158700 caused crashes in the gcc test suite,
g++.abi/vtable3a.C among others. It also caused failures in the libc++
test suite.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158749 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
ed35fd1c6db1680b4526ba64c94e5da6ec203be7 19-Jun-2012 Aaron Ballman <aaron@aaronballman.com> Improves parsing and semantic analysis for MS __declspec attributes. This includes support for the align (which fixes PR12631).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158717 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
f198d126ecec1e07a474c419de1bf4dadf92a490 17-Jun-2012 James Dennett <jdennett@google.com> Documentation cleanup: fixing a typo from my previous 'fix'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158617 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
ef2b5b327b524f9ea3243c07e04fb24706e63120 16-Jun-2012 James Dennett <jdennett@google.com> Documentation cleanup:
* Escaped "::" and "<" as needed in Doxygen comments;
* Marked up code examples with \code...\endcode;
* Documented a \param that is current, instead of a few that aren't;
* Fixed up some \file and \brief comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158562 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
1dfbd92c83699820bfaa352e83083124e34fc9dc 14-Jun-2012 James Dennett <jdennett@google.com> Still more Doxygen documentation fixes:
* Escape #, < and @ symbols where Doxygen would try to interpret them;
* Fix several function param documentation where names had got out of sync;
* Delete param documentation referring to parameters that no longer exist.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158472 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
ca5233044ef679840d1ad1c46a36b16e2ee8a6e1 10-Jun-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR13064: Store whether an in-class initializer uses direct or copy
initialization, and use that information to produce the right kind of
initialization during template instantiation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158288 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
581deb3da481053c4993c7600f97acf7768caac5 06-Jun-2012 David Blaikie <dblaikie@gmail.com> Revert Decl's iterators back to pointer value_type rather than reference value_type

In addition, I've made the pointer and reference typedef 'void' rather than T*
just so they can't get misused. I would've omitted them entirely but
std::distance likes them to be there even if it doesn't use them.

This rolls back r155808 and r155869.

Review by Doug Gregor incorporating feedback from Chandler Carruth.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158104 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
703b6015176550eefc91f3e2f19cd19beacbc592 23-May-2012 Richard Smith <richard-llvm@metafoo.co.uk> Correct the starting location for instantiations of field declarations which
start with a cv-qualifier. DeclaratorDecl::getTypeSpecStartLoc() does not
produce the location of the first type-specifier (the cv-qualifier) in this
case, because we don't track source locations for cv-qualifiers.

No test here: I've not found a way to test this with a lit-style test, and
introducing a gtest test for this seems unwarranted. Suggestions welcome!

Patch by Daniel Jasper!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157311 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
31c195ac0f3869e742d42f9d02b6cd33442fb630 15-May-2012 Rafael Espindola <rafael.espindola@gmail.com> Fix our handling of visibility in explicit template instantiations.

* Don't copy the visibility attribute during instantiations. We have to be able
to distinguish

struct HIDDEN foo {};
template<class T>
DEFAULT void bar() {}
template DEFAULT void bar<foo>();

from

struct HIDDEN foo {};
template<class T>
DEFAULT void bar() {}
template void bar<foo>();

* If an instantiation has an attribute, it takes precedence over an attribute
in the template.

* With instantiation attributes handled with the above logic, we can now
select the minimum visibility when looking at template arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156821 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
ab41fe914f63bb470dfa7e400876ada72f57a931 05-May-2012 Douglas Gregor <dgregor@apple.com> Move Sema::VerifyIntegerConstantExpression() and
Sema::ConvertToIntegralOrEnumerationType() from PartialDiagnostics to
abstract "diagnoser" classes. Not much of a win here, but we're
-several PartialDiagnostics.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156217 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
262bc18e32500558af7cb0afa205b34bd37bafed 30-Apr-2012 David Blaikie <dblaikie@gmail.com> Remove the ref/value inconsistency in filter_decl_iterator.

filter_decl_iterator had a weird mismatch where both op* and op-> returned T*
making it difficult to generalize this filtering behavior into a reusable
library of any kind.

This change errs on the side of value, making op-> return T* and op* return
T&.

(reviewed by Richard Smith)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155808 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
13bffc532bafd45d4a77867993c1afb83c7661be 19-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR 12586: Fix assert while running libc++ testsuite: deal with exception
specifications on member function templates of class templates and other such
nested beasties. Store the function template from which we are to instantiate
an exception specification rather than trying to deduce it. Plus some
additional test cases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155076 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
87162c2e528921aabb84e96fe7272348a4b3354e 18-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR12569: Instantiate exception specifications of explicit instantiations
and explicit specializations of function templates appropriately.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154956 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
e6975e9b0985ad7f7ff9187e38d95bfe9ac4181b 17-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> Implement DR1330 in C++11 mode, to support libstdc++4.7 which uses it.

We have a new flavor of exception specification, EST_Uninstantiated. A function
type with this exception specification carries a pointer to a FunctionDecl, and
the exception specification for that FunctionDecl is instantiated (if needed)
and used in the place of the function type's exception specification.

When a function template declaration with a non-trivial exception specification
is instantiated, the specialization's exception specification is set to this
new 'uninstantiated' kind rather than being instantiated immediately.

Expr::CanThrow has migrated onto Sema, so it can instantiate exception specs
on-demand. Also, any odr-use of a function triggers the instantiation of its
exception specification (the exception specification could be needed by IRGen).
In passing, fix two places where a DeclRefExpr was created but the corresponding
function was not actually marked odr-used. We used to get away with this, but
don't any more.

Also fix a bug where instantiating an exception specification which refers to
function parameters resulted in a crash. We still have the same bug in default
arguments, which I'll be looking into next.

This, plus a tiny patch to fix libstdc++'s common_type, is enough for clang to
parse (and, in very limited testing, support) all of libstdc++4.7's standard
headers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154886 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
cefc3afac14d29de5aba7810cc8fe6c858949e9d 16-Apr-2012 Douglas Gregor <dgregor@apple.com> Implement C++11 [expr.prim.general]p3, which permits the use of 'this'
in the declaration of a non-static member function after the
(optional) cv-qualifier-seq, which in practice means in the exception
specification and late-specified return type.

The new scheme here used to manage 'this' outside of a member function
scope is more general than the Scope-based mechanism previously used
for non-static data member initializers and late-parsesd attributes,
because it can also handle the cv-qualifiers on the member
function. Note, however, that a separate pass is required for static
member functions to determine whether 'this' was used, because we
might not know that we have a static function until after declaration
matching.

Finally, this introduces name mangling for 'this' and for the implicit
'this', which is intended to match GCC's mangling. Independent
verification for the new mangling test case would be appreciated.

Fixes PR10036 and PR12450.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154799 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
95e3872918557b55b62121a7df5f1ee76d45881a 04-Apr-2012 Nick Lewycky <nicholas@mxc.ca> If something already instantiated is reinstantiated as an explicit definition,
keep the latter.

No test. This was noticed when poking around something else with GDB. I'm not
able to figure out a testcase that would break due to this bug. Sorry.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153992 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
c5a89a1cc2f168ad0a115c560b8de5f1c952d8c5 02-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> Basic semantic analysis support for inheriting constructor declarations in
dependent contexts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153858 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
1e1e9722cb4ea6027e2c4885c7a8f26d3726ca7d 28-Mar-2012 Douglas Gregor <dgregor@apple.com> When we form a new function/class template specialization, we first
search for the specialization (in a folding set) and, if not found
form a *Decl that is then inserted into that folding set. In rare
cases, the folding set may be reallocated between the search and the
insertion, causing a crash. No test case, because triggering rehashing
consistently in a small test case is not feasible. Fixes
<rdar://problem/11115071>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153575 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
0724b7c43007d978c46f890dcd2ab3c8d3c22920 26-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Add a special-case diagnostic for one of the more obnoxious special cases of
unscoped enumeration members: an enumerator name which is visible in the
out-of-class definition of a member of a templated class might not actually
exist in the instantiation of that class, if the enumeration is also lexically
defined outside the class definition and is explicitly specialized.

Depending on the result of a CWG discussion, we may have a different resolution
for a class of problems in this area, but this fixes the immediate issue of a
crash-on-invalid / accepts-invalid (depending on +Asserts). Thanks to Johannes
Schaub for digging into the standard wording to find how this case is currently
specified to behave.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153461 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
38f0df352fadc546c5666079fb22de5ec1819d92 26-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Handle instantiations of redeclarations of forward-declared enumerations within
templated functions. Build a redeclaration chain, and only instantiate the
definition of the enum when visiting the defining declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153427 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
4ca93d9978aac02b01814b4f749d6903a1f87ee5 26-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Delay checking of dependent underlying types for redeclarations of member
enumerations in templates until the template is instantiated.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153426 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
1af83c444e5a2f6f50a6e1c15e6ebc618ae18a5f 23-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Support for definitions of member enumerations of class templates outside the
class template's definition, and for explicit specializations of such enum
members.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153304 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
f1c66b40213784a1c4612f04c14cafa2b0e89988 15-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Instantiating a class template should not instantiate the definition of any
scoped enumeration members. Later uses of an enumeration temploid as a nested
name specifier should cause its instantiation. Plus some groundwork for
explicit specialization of member enumerations of class templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152750 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
7c5d28b6342229fb648aea59dc063f67ff16bc81 13-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR11850 + duplicates: don't assume that a function parameter pack expansion is
at the end of the parameter list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152618 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
1b7f9cbed1b96b58a6e5f7808ebc9345a76a0936 13-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix PR10447: lazily building name lookup tables for DeclContexts was broken.
The deferred lookup table building step couldn't accurately tell which Decls
should be included in the lookup table, and consequently built different tables
in some cases.

Fix this by removing lazy building of DeclContext name lookup tables. In
practice, the laziness was frequently not worthwhile in C++, because we
performed lookup into most DeclContexts. In C, it had a bit more value,
since there is no qualified lookup.

In the place of lazy lookup table building, we simply don't build lookup tables
for function DeclContexts at all. Such name lookup tables are not useful, since
they don't capture the scoping information required to correctly perform name
lookup in a function scope.

The resulting performance delta is within the noise on my testing, but appears
to be a very slight win for C++ and a very slight loss for C. The C performance
can probably be recovered (if it is a measurable problem) by avoiding building
the lookup table for the translation unit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152608 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
4e4d08403ca5cfd4d558fa2936215d3a4e5a528d 11-Mar-2012 David Blaikie <dblaikie@gmail.com> Unify naming of LangOptions variable/get function across the Clang stack (Lex to AST).

The member variable is always "LangOpts" and the member function is always "getLangOpts".

Reviewed by Chris Lattner

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152536 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
025039377d7247620750205dbd61ca1ba336f7e0 08-Mar-2012 Rafael Espindola <rafael.espindola@gmail.com> Replace MarkVarRequired with a more generic
HandleCXXStaticMemberVarInstantiation. Suggested by Argyrios.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152320 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
234fe654a3dd2888be42ae5db34db96c5c2c4ba3 05-Mar-2012 Rafael Espindola <rafael.espindola@gmail.com> Fix a small difference in sema and codegen views of what needs to be output.

In the included testcase, soma thinks that we already have a definition after we
see the out of line decl. Codegen puts it in a deferred list, to be output if
a use is seen. This would break when we saw an explicit template instantiation
definition, since codegen would not be notified.

This patch adds a method to the consumer interface so that soma can notify
codegen that this decl is now required.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152024 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
7bdc15252ca2415f149ad812f0e5184d758e6105 16-Feb-2012 Douglas Gregor <dgregor@apple.com> Lambda closure types are always considered to be like "local" classes,
even if they are not within a function scope. Teach template
instantiation to treat them as such, and make sure that we have a
local instantiation scope when instantiating default arguments and
static data members.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150725 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
dd5756c04c98e354b85c4f7eb660ae60c6d341ec 16-Feb-2012 DeLesley Hutchins <delesley@google.com> Minor fix to template instantiation, which properly instantiates
dependent attributes on static members of templatized classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150704 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
86c3ae46250cdcc57778c27826060779a92f3815 13-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Update constexpr implementation to match CWG's chosen approach for core issues
1358, 1360, 1452 and 1453.
- Instantiations of constexpr functions are always constexpr. This removes the
need for separate declaration/definition checking, which is now gone.
- This makes it possible for a constexpr function to be virtual, if they are
only dependently virtual. Virtual calls to such functions are not constant
expressions.
- Likewise, it's now possible for a literal type to have virtual base classes.
A constexpr constructor for such a type cannot actually produce a constant
expression, though, so add a special-case diagnostic for a constructor call
to such a type rather than trying to evaluate it.
- Classes with trivial default constructors (for which value initialization can
produce a fully-initialized value) are considered literal types.
- Classes with volatile members are not literal types.
- constexpr constructors can be members of non-literal types. We do not yet use
static initialization for global objects constructed in this way.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150359 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
5b9cc5df25c2198f270dd1d5c438fdce70d4051d 12-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Represent C++ direct initializers as ParenListExprs before semantic analysis
instead of having a special-purpose function.

- ActOnCXXDirectInitializer, which was mostly duplication of
AddInitializerToDecl (leading e.g. to PR10620, which Eli fixed a few days
ago), is dropped completely.
- MultiInitializer, which was an ugly hack I added, is dropped again.
- We now have the infrastructure in place to distinguish between
int x = {1};
int x({1});
int x{1};
-- VarDecl now has getInitStyle(), which indicates which of the above was used.
-- CXXConstructExpr now has a flag to indicate that it represents list-
initialization, although this is not yet used.
- InstantiateInitializer was renamed to SubstInitializer and simplified.
- ActOnParenOrParenListExpr has been replaced by ActOnParenListExpr, which
always produces a ParenListExpr. Placed that so far failed to convert that
back to a ParenExpr containing comma operators have been fixed. I'm pretty
sure I could have made a crashing test case before this.

The end result is a (I hope) considerably cleaner design of initializers.
More importantly, the fact that I can now distinguish between the various
initialization kinds means that I can get the tricky generalized initializer
test cases Johannes Schaub supplied to work. (This is not yet done.)

This commit passed self-host, with the resulting compiler passing the tests. I
hope it doesn't break more complicated code. It's a pretty big change, but one
that I feel is necessary.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150318 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
5bbc385ad2d8e487edfbc2756eaf4fb0b920cfe4 06-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Move instantiateTemplateAttribute into the sema namespace, make helpers static.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149864 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
282e7e66748cc6dd14d6f7f2cb52e5373c531e61 04-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> In C++11 mode, when an integral constant expression is desired and we have a
value of class type, look for a unique conversion operator converting to
integral or unscoped enumeration type and use that. Implements [expr.const]p5.

Sema::VerifyIntegerConstantExpression now performs the conversion and returns
the converted result. Some important callers of Expr::isIntegralConstantExpr
have been switched over to using it (including all of those required for C++11
conformance); this switch brings a side-benefit of improved diagnostics and, in
several cases, simpler code. However, some language extensions and attributes
have not been moved across and will not perform implicit conversions on
constant expressions of literal class type where an ICE is required.

In passing, fix static_assert to perform a contextual conversion to bool on its
argument.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149776 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
d1bb4ae6cbc0f8bea4b329e040f58b18c03388e7 25-Jan-2012 Douglas Gregor <dgregor@apple.com> When we're substituting into a function parameter pack and expect to
get a function parameter pack (but don't due to weird substitutions),
complain. Fixes the last bit of PR11848.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148960 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
23323e0253716ff03c95a00fb6903019daafe3aa 20-Jan-2012 DeLesley Hutchins <delesley@google.com> Delayed template instantiation of late-parsed attributes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148595 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
7b9ff0c09025dcbe48ec7db71330e2066d1e1863 20-Jan-2012 DeLesley Hutchins <delesley@google.com> Instantiate dependent attributes when instantiating templates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148592 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
dc370c1e70a2f876c65be4057ead751b72c8ddd5 20-Jan-2012 Benjamin Kramer <benny.kra@googlemail.com> Remove unused variables.

Found by clang's own static analyzer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148542 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
796c1a1e3e63e459e371383ac878aa5f40b02a8c 19-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> An instantiation of a constexpr static data member in a class template is
constexpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148505 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
ef96ee0be5f100789f451641542a69cd719144d2 14-Jan-2012 Douglas Gregor <dgregor@apple.com> De-virtualize getPreviousDecl() and getMostRecentDecl() when we know
we have a redeclarable type, and only use the new virtual versions
(getPreviousDeclImpl() and getMostRecentDeclImpl()) when we don't have
that type information. This keeps us from penalizing users with strict
type information (and is the moral equivalent of a "final" method).

Plus, settle on the names getPreviousDecl() and getMostRecentDecl()
throughout.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148187 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
6aeaa60217e1ed11a621409acf1b53df0d14b591 05-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Tweak the fix to PR8977: an empty expression-list represents value initialization, not default initialization. Fixes PR11712.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147620 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
5df37bd0242e838e465f0bd51a70af424d152053 26-Dec-2011 Rafael Espindola <rafael.espindola@gmail.com> Delay checking of typedefs of dependent types. Fixes PR11630.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147281 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
3e9ea0b8cd7c4691d62e385245556be5fded58a7 21-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> C++ constant expression handling: eagerly instantiate static const integral data
members of class templates so that their values can be used in ICEs. This
required reverting r105465, to get such instantiated members to be included in
serialized ASTs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147023 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
f6702a3927147655206ae729a84339c4fda4c651 20-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Unlike in C++03, a constant-expression is not an unevaluated operand in C++11.
Split out a new ExpressionEvaluationContext flag for this case, and don't treat
it as unevaluated in C++11. This fixes some crash-on-invalids where we would
allow references to class members in potentially-evaluated constant expressions
in static member functions, and also fixes half of PR10177.

The fix to PR10177 exposed a case where template instantiation failed to provide
a source location for a diagnostic, so TreeTransform has been tweaked to supply
source locations when transforming a type. The source location is still not very
good, but MarkDeclarationsReferencedInType would need to operate on a TypeLoc to
improve it further.

Also fix MarkDeclarationReferenced in C++98 mode to trigger instantiation for
static data members of class templates which are used in constant expressions.
This fixes a link-time problem, but we still incorrectly treat the member as
non-constant. The rest of the fix for that issue is blocked on PCH support for
early-instantiated static data members, which will be added in a subsequent
patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146955 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
9aab9c4116bb3ea876d92d4af10bff7f4c451f24 10-Dec-2011 Douglas Gregor <dgregor@apple.com> Make sure that we infer __strong, etc. when we instantiate variables
under ARC. Fixes <rdar://problem/10530209>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146307 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
4c51548271d2f8385127e1d943764ae8939d7794 26-Nov-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed lexical declaration context when instantiating a friend / out-of-line class template member.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145146 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
e994624c001143ee2b8a7a4715aaad5efcd71f18 18-Nov-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed implicit instantiations source range.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144977 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
3bc451593fa44bfc45753e44e37cb4242e714f82 15-Nov-2011 Eli Friedman <eli.friedman@gmail.com> Compute whether a class is trivial correctly for template classes with an explicitly deleted or defaulted special member. PR11387.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144715 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
64b4b43a23aa8b8009470e3cc451333f623d7d58 10-Nov-2011 David Blaikie <dblaikie@gmail.com> Removing unused initialization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144264 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
2c1227c4da661bdc0b1976740c3ff203ed7609b2 07-Nov-2011 Douglas Gregor <dgregor@apple.com> Drastically simplify the mapping from the declaration corresponding to
the injected-class-name of a class (or class template) to the
declaration that results from substituting the given template
arguments. Previously, we would actually perform a substitution into
the injected-class-name type and then retrieve the resulting
declaration. However, in certain, rare circumstances involving
deeply-nested member templates, we would get the wrong substitution
arguments.

This new approach just matches up the declaration with a declaration
that's part of the current context (or one of its parents), which will
either be an instantiation (during template instantiation) or the
declaration itself (during the definition of the template). This is
both more efficient (we're avoiding a substitution) and more correct
(we can't get the template arguments wrong in the member-template
case).

Fixes <rdar://problem/9676205>.

Reinstated, now that we have the fix in r143967.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143968 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
03ea52f9f0f6fc796ecae5b568a7be489438269b 04-Nov-2011 Devang Patel <dpatel@apple.com> Revert r143551. It is causing g++.dg/template/crash52.C test failure.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143725 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
0b1beb7a295b20f7e05479d599dde027f9f692fe 02-Nov-2011 Douglas Gregor <dgregor@apple.com> Drastically simplify the mapping from the declaration corresponding to
the injected-class-name of a class (or class template) to the
declaration that results from substituting the given template
arguments. Previously, we would actually perform a substitution into
the injected-class-name type and then retrieve the resulting
declaration. However, in certain, rare circumstances involving
deeply-nested member templates, we would get the wrong substitution
arguments.

This new approach just matches up the declaration with a declaration
that's part of the current context (or one of its parents), which will
either be an instantiation (during template instantiation) or the
declaration itself (during the definition of the template). This is
both more efficient (we're avoiding a substitution) and more correct
(we can't get the template arguments wrong in the member-template
case).

Fixes <rdar://problem/9676205>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143551 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
76852c218a207ef43583515cb835b6e855353a0f 01-Nov-2011 Douglas Gregor <dgregor@apple.com> Rework the AST for the initializer of a delegating constructor, so
that it retains source location information for the type. Aside from
general goodness (being able to walk the types described in that
information), we now have a proper representation for dependent
delegating constructors. Fixes PR10457 (for real).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143410 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
0216df8fd3ce58f5a68ef2ab141ea34c96c11164 29-Oct-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed FriendDecl source locations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143295 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
53e535161dfa9850de394b300915fc250eb0fdf4 19-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Add a -Wc++98-compat warning for friend functions of class templates which would
be implicitly instantiated (resulting in a redefinition) in C++98.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142468 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
c046f30721fbb950f28faf9faa9a050f1fcc9bec 17-Oct-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Revert r142142: "Make a C-style cast a const-cast, to suppress a GCC warning."
Richard already fixed the underlying issue, so the cast was superfluous.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142192 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
68ff8d627e19f37601e28f5218212ca715bac842 16-Oct-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Make a C-style cast a const-cast, to suppress a GCC warning. I should fix the underlying issue eventually, but this interface will probably change anyway.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142142 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
2c712f50cd56eaf3662989b556e9c6b1e8fcd11a 11-Oct-2011 Kaelyn Uhrain <rikka@google.com> Move some bool flags out of function parameter lists.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141610 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
5c340e803ed2e384ff47f3e560df253515c92e1e 09-Oct-2011 Douglas Gregor <dgregor@apple.com> After instantiating a 'noexcept' expression, be sure to convert it to
a boolean value and check that it is a constant expression. Fixes
PR11084.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141511 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
54dec5f9ad13597bbebb6872ab938e2ad4b6aa1b 08-Oct-2011 Benjamin Kramer <benny.kra@googlemail.com> Silence a warning about casting away constness.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141496 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
a789ca9b967abe47b84df83bcf4afb150856a8d9 08-Oct-2011 NAKAMURA Takumi <geek4civic@gmail.com> Whitespace

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141486 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
9f569cca2a4c5fb6026005434e27025b9e71309d 01-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: semantic checking for constexpr functions and constructors. Based in
part on patches by Peter Collingbourne.

We diverge from the C++11 standard in a few areas, mostly related to checking
constexpr function declarations, and not just definitions. See WG21 paper
N3308=11-0078 for details.

Function invocation substitution is not available in this patch; constexpr
functions cannot yet be used from within constant expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140926 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
6df6548e44a61c444bd85dccd0398cba047c79b1 24-Sep-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Correctly parse braced member initializers (even in delayed parsing) and correctly pass
the information on to Sema. There's still an incorrectness in the way template instantiation
works now, but that is due to a far larger underlying representational problem.
Also add a test case for various list initialization cases of scalars, which test this
commit as well as the previous one.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140460 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
eb2d1f1c88836bd5382e5d7aa8f6b85148a88b27 23-Sep-2011 David Blaikie <dblaikie@gmail.com> Removing a bunch of dead returns/breaks after llvm_unreachables.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140407 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
b219cfc4d75f0a03630b7c4509ef791b7e97b2c8 23-Sep-2011 David Blaikie <dblaikie@gmail.com> Switch assert(0/false) llvm_unreachable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140367 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
a71f9d0a5e1f8cafdd23a17e292de22fdc8e99ff 22-Sep-2011 David Blaikie <dblaikie@gmail.com> ArrayRef-ifying the UnexpandedParameterPacks passed to Sema::CheckParameterPacksForExpansion


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140290 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
4278c654b645402554eb52a48e9c7097c9f1233a 21-Sep-2011 David Blaikie <dblaikie@gmail.com> ArrayRef-ifying Function/BlockDecl's setParams


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140268 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
90ab75b5ad328d2b155ec83fd4e80cd0f7af5729 09-Sep-2011 Richard Trieu <rtrieu@google.com> Changed references of BaseTy, MemInitTy, CXXScopeTy, TemplateParamsTy to CXXBaseSpecifier, CXXCtorInitializer, NestedNameSpecifier, TemplateParameterList and removed their typedefs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139350 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
80f5b16efb658dabbcf971f42ed8b789aaaa6baa 18-Aug-2011 Chandler Carruth <chandlerc@gmail.com> Always mark friend function declarations in class templates as
implicitly instantiable, even if we don't see a body on the friend
function declaration. The body may simply have not yet been attached.
This fixes PR10666.

There may be an alternate, preferred implementation strategy, see my
FIXME. Review would definitely be appreciated Doug. =D

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137934 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
af1fc7af351758b0ea0d285bdfe5640128109a4e 15-Aug-2011 Richard Smith <richard-llvm@metafoo.co.uk> Track in the AST whether a function is constexpr.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137653 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
af0f4d0b2e38c810effc8b024ad2fb6604eec5d3 14-Aug-2011 Francois Pichet <pichet2000@gmail.com> Implement function template specialization at class scope extension in Microsoft mode. A new AST node is introduced: ClassScopeFunctionSpecialization. This node holds a FunctionDecl that is not yet specialized; then during the class template instantiation the ClassScopeFunctionSpecialization will spawn the actual function specialization.

Example:
template <class T>
class A {
public:
template <class U> void f(U p) { }
template <> void f(int p) { } // <== class scope specialization
};

This extension is necessary to parse MSVC standard C++ headers, MFC and ATL code.
BTW, with this feature in, clang can parse (-fsyntax-only) all the MSVC 2010 standard header files without any error.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137573 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
6e4a3f5c59664af13e02e9bb58c2810b830e3b96 28-Jul-2011 Douglas Gregor <dgregor@apple.com> Make the deserialization of Sema::PendingInstantiations lazy. At this
point, ASTReader::InitializeSema() has very little interesting work,
*except* issues stemming from preloaded declarations. That's something
we'll still need to cope with.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136378 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
5f9e272e632e951b1efe824cd16acb4d96077930 23-Jul-2011 Chris Lattner <sabre@nondot.org> remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports
them into the clang namespace.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135852 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
0ff6f8f038f32d85c32fd984673cea51ef737b22 20-Jul-2011 Richard Smith <richard-llvm@metafoo.co.uk> Replace r134583's fix for PR10290 with one which also works for non-value-dependent cases.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135543 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
19f74acdf8842ceece578b7307884f5ba22d7f59 06-Jul-2011 Rafael Espindola <rafael.espindola@gmail.com> Use attributes from the definition (if available) when
instantiating functions.

Fixes PR10272.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134491 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
5cbe101b502e06d16bc77df45a27ce8bc13f33c8 05-Jul-2011 Douglas Gregor <dgregor@apple.com> Look through parenthesized declarators when determining whether an
instantiated function template was written with a prototype or via
some kind of typedef. Fixes PR10273 / <rdar://problem/9723679>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134426 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
561f81243f665cf2001caadc45df505f826b72d6 01-Jul-2011 Douglas Gregor <dgregor@apple.com> Introduce the notion of instantiation dependence into Clang's AST. A
type/expression/template argument/etc. is instantiation-dependent if
it somehow involves a template parameter, even if it doesn't meet the
requirements for the more common kinds of dependence (dependent type,
type-dependent expression, value-dependent expression).

When we see an instantiation-dependent type, we know we always need to
perform substitution into that instantiation-dependent type. This
keeps us from short-circuiting evaluation in places where we
shouldn't, and lets us properly implement C++0x [temp.type]p2.

In theory, this would also allow us to properly mangle
instantiation-dependent-but-not-dependent decltype types per the
Itanium C++ ABI, but we aren't quite there because we still mangle
based on the canonical type in cases like, e.g.,

template<unsigned> struct A { };
template<typename T>
void f(A<sizeof(sizeof(decltype(T() + T())))>) { }
template void f<int>(A<sizeof(sizeof(int))>);

and therefore get the wrong answer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134225 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
1d441ee69aaf3b3afa4521d05df934c5c7ea5f62 22-Jun-2011 Douglas Gregor <dgregor@apple.com> When instantiating a function template declaration that was expressed
via a typedef of a function, make sure to synthesize parameter
declarations. Fixes PR9654 / <rdar://problem/9257497>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133628 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
e3499cae8e5323ac553ad56977bf1cd42b9a5a35 22-Jun-2011 Richard Smith <richard-llvm@metafoo.co.uk> Fix PR10168: don't warn for unused non-dependent variables in both the template definition and each instantiation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133580 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
7a614d8380297fcd2bc23986241905d97222948c 11-Jun-2011 Richard Smith <richard-llvm@metafoo.co.uk> Implement support for C++11 in-class initialization of non-static data members.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132878 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
f15748a28c8443eef2924ef83689c358c661e9c5 03-Jun-2011 Douglas Gregor <dgregor@apple.com> When performing template argument deduction given a function argument
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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132530 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
3617e198aa89d4aa0921343a22b96823a63f8a58 01-Jun-2011 Douglas Gregor <dgregor@apple.com> The expression in a noexcept exception-specification is a
constant-expression, and, therefore, an unevaluated operand. Make it
so.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132400 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
8155910a192dafa423d6b932b7d127d48e4641e8 31-May-2011 Nick Lewycky <nicholas@mxc.ca> Whenever we instantiate a static data member, make sure to define any new
vtables! Fixes PR10020

This also allows us to revert the part of r130023 which added a big loop around
the template instantiation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132331 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
f996e051d9953550982b57132daad8a5e3f7bd65 27-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Add assertions to verify that we are not trying to instantiate a
nontemplate in Sema::InstantiateTemplateDecl.

This should make the issue in PR10026 more visible, although it's not
going to fix it because something is violating this precondition.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132208 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
855f41963e545172a935d07b4713d079e258a207 27-May-2011 Richard Trieu <rtrieu@google.com> Add an additional check for null pointer before accessing PatternDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132175 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
dfab854e6855dad076c0207b29859d452e398437 26-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Fix a minor thinko that leads to a crash if PatternDecl is null but
Pattern is not. Thanks Nick for catching this!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132089 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
2545ce1c76236c2277b90dbd4f7d01ef13fe0823 24-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Delete the extraneous return statement that was causing my earlier
issues and also add a test.

We should now handle defaulted members of templates properly. No
comment as to whether or not this also holds for templated functions,
but defaulting those is kind of insane.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131938 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
cd10dec673680fd18a2e5a27646173780c059d32 24-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement explicit specialization of explicitly-defaulted constructors.
The general out-of-line case (including explicit instantiation mostly
works except that the definition is being lost somewhere between the AST
and CodeGen, so the definition is never emitted.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131933 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
eb88ae5f9acdd17ec76fb83e151a77e25e4e8f31 23-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Correctly propagate defaultedness across template instantiation. This
fixes PR9965, but we're not out of the water yet, as we do not
successfully handle out-of-line definitions, due to my utter
misunderstanding of how we manage templates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131920 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
8a29bc047a374df2464869b55581c24def68c2ec 12-May-2011 Nick Lewycky <nicholas@mxc.ca> Fix crasher spotted in IWYU.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131222 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
10620eb5164e31208fcbf0437cd79ae535ed0559 06-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Modify some deleted function methods to better reflect reality:

- New isDefined() function checks for deletedness
- isThisDeclarationADefinition checks for deletedness
- New doesThisDeclarationHaveABody() does what
isThisDeclarationADefinition() used to do
- The IsDeleted bit is not propagated across redeclarations
- isDeleted() now checks the canoncial declaration
- New isDeletedAsWritten() does what it says on the tin.
- isUserProvided() now correct (thanks Richard!)

This fixes the bug that we weren't catching

void foo() = delete;
void foo() {}

as being a redefinition.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131013 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
5f802e51406664ca9b6e0d57fc7ce37ea97a1c65 06-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Revert r130912 in order to approach defaulted functions from the other
direction and not introduce things in the wrong place three different
times.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130968 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
3e4c6c4c79a03f5cb0c4671d7c282d623c6dc35e 05-May-2011 Richard Smith <richard-llvm@metafoo.co.uk> Implement support for C++0x alias templates.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130953 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
ad7ec12ef2edbadb85a3754f0395ef2f06d4256c 05-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement some framework for defaulted constructors.

There's some unused stuff for now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130912 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
e099c00a065c3a43706b8da71cfe655ff7a2c1c6 02-May-2011 Nick Lewycky <nicholas@mxc.ca> Remove redeclaration of Invalid. The code that set this to true was updating an
Invalid that was never read from again, causing non-type-template-parms to be
marked valid when in fact they weren't.

This was caught by GCC 4.6's -Wunused-but-set-variable warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130680 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
fb44de956f27875def889482b5393475060392af 02-May-2011 John McCall <rjmccall@apple.com> Store a parameter index and function prototype depth in every
parameter node and use this to correctly mangle parameter
references in function template signatures.

A follow-up patch will improve the storage usage of these
fields; here I've just done the lazy thing.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130669 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
4fb86f8c4585e53c21c847ad3de9e3b2de123cd9 01-May-2011 Chandler Carruth <chandlerc@gmail.com> Re-applies the patch first applied way back in r106099, with
accompanying fixes to make it work today.

The core of this patch is to provide a link from a TemplateTypeParmType
back to the TemplateTypeParmDecl node which declared it. This in turn
provides much more precise information about the type, where it came
from, and how it functions for AST consumers.

To make the patch work almost a year after its first attempt, it needed
serialization support, and it now retains the old getName() interface.
Finally, it requires us to not attempt to instantiate the type in an
unsupported friend decl -- specifically those coming from template
friend decls but which refer to a specific type through a dependent
name.

A cleaner representation of the last item would be to build
FriendTemplateDecl nodes for these, storing their template parameters
etc, and to perform proper instantation of them like any other template
declaration. They can still be flagged as unsupported for the purpose of
access checking, etc.

This passed an asserts-enabled bootstrap for me, and the reduced test
case mentioned in the original review thread no longer causes issues,
likely fixed at somewhere amidst the 24k revisions that have elapsed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130628 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
4a47e8d35dc1778ef7e428d9edd7676be67e725f 23-Apr-2011 Francois Pichet <pichet2000@gmail.com> Remove unnecessary const away cast in LateTemplateParserCallback.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130058 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
788440378c442562497c09610939cbe6218ab43d 23-Apr-2011 Douglas Gregor <dgregor@apple.com> At the end of the translation unit, defining a vtable can introduce
new templates that need to be instantiated and vice-versa. Iterate
until we've instantiated all required templates and defined all
required vtables. Fixed PR9325 / <rdar://problem/9055177>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130023 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
8387e2a41eef6fa17fb140a18c29b6eee9dd2b8a 23-Apr-2011 Francois Pichet <pichet2000@gmail.com> Add -fdelayed-template-parsing option. Using this option all templated function definitions are parsed at the end of the translation unit only if it is required by an actual instantiation. As such all the symbols of the TU are available during name lookup.

Using this flag is necessary for compatibility with Microsoft template code.
This also provides some parsing speed improvement.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130022 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
6b6b42aed07726178f61954ac6e51f47da00275c 19-Apr-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> We regard a function as 'unused' from the codegen perspective, so our warnings diverge from
gcc's unused warnings which don't get emitted if the function is referenced even in an unevaluated context
(e.g. in templates, sizeof, etc.). Also, saying that a function is 'unused' because it won't get codegen'ed
is somewhat misleading.

- Don't emit 'unused' warnings for functions that are referenced in any part of the user's code.
- A warning that an internal function/variable won't get emitted is useful though, so introduce
-Wunneeded-internal-declaration which will warn if a function/variable with internal linkage is not
"needed" ('used' from the codegen perspective), e.g:

static void foo() { }

template <int>
void bar() {
foo();
}

test.cpp:1:13: warning: function 'foo' is not needed and will not be emitted
static void foo() { }
^

Addresses rdar://8733476.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129794 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
162e1c1b487352434552147967c3dd296ebee2f7 15-Apr-2011 Richard Smith <richard-llvm@metafoo.co.uk> Support for C++11 (non-template) alias declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129567 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
ad762fcdc16b9e4705b12b09d92b8c026212b906 15-Apr-2011 Richard Smith <richard-llvm@metafoo.co.uk> Add support for C++0x's range-based for loops, as specified by the C++11 draft standard (N3291).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129541 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
56fb926c93786739cfd0867e7ada31ace3bda946 14-Mar-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Implement instantiation of noexcept spec and add a test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127603 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
60618fa7f88d5162bb5b40988b6b38d4d75d6fc6 12-Mar-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Propagate the new exception information to FunctionProtoType.
Change the interface to expose the new information and deal with the enormous fallout.
Introduce the new ExceptionSpecificationType value EST_DynamicNone to more easily deal with empty throw specifications.
Update the tests for noexcept and fix the various bugs uncovered, such as lack of tentative parsing support.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127537 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
ba877adeb49ed6dc17f27fa3a3bcd0cca713fd68 09-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed InnerLocStart.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127330 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
f52516038ab5d0b1b90a6dd32f46b7d6dabd04c8 08-Mar-2011 Douglas Gregor <dgregor@apple.com> Teach libclang's token-annotation logic about context-sensitive
keywords for Objective-C+ and C++0x.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127253 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
a2026c96d3935e7909e049ad9096762844544ed6 08-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed source range for StaticAssertDecl and LinkageSpecDecl. Fixed source range for declarations using postfix types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127251 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
ff676cb48fe8bf7be2feaa251dc7c5fb15af4730 08-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed source range for all DeclaratorDecl's.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127225 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
eff1dbec93999bfc5406eb861efd8add9de23633 06-Mar-2011 Douglas Gregor <dgregor@apple.com> We may fail to map a declaration in a template to its instantiated
declaration because of interesting ordering dependencies while
instantiating a class template or member class thereof. Complain,
rather than asserting (+Asserts) or silently rejecting the code
(-Asserts).

Fixes the crash-on-invalid in PR8965.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127129 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
a868c3799b739781db325c1bd2c6afd182bc9bd6 06-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Completed source ranges fixes for all classes inheriting from TypeDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127120 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
344577e6b58f42d18dc8118c8903b49a85dc005e 06-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed TypedefDecl and TemplateTypeParameter source range.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127119 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
8b5b4099c61a136e9a1714c4d8a593febe942268 06-Mar-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Reinstate r127112, "Propagate new-style exception spec information to ExtProtoInfo.", this time with the missing header.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127118 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
708a86690469474f0a8149abca71aa4c62bf9710 06-Mar-2011 NAKAMURA Takumi <geek4civic@gmail.com> Revert r127112, "Propagate new-style exception spec information to ExtProtoInfo."

It seems missing "clang/Basic/ExceptionSpecificationType.h".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127115 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
06bfa84588658d721094f383d6950e75100c4c4c 05-Mar-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Propagate new-style exception spec information to ExtProtoInfo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127112 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
a93fc9f053bae84cf7c2a04ea6b1b26e0ea44d8f 04-Mar-2011 Douglas Gregor <dgregor@apple.com> After an error of any kind has occurred, don't assert when attempting
to find the instantiated declaration within a template instantiation
fails to do so. It's likely that the original instantiation got
dropped due to instantiation failures, which doesn't actually break
the invariants of the AST. This eliminates a number of
crash-on-invalid failures, e.g., PR9300.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127030 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
b710722d2348cd0945d2b4f02062c7f685146eb0 04-Mar-2011 Douglas Gregor <dgregor@apple.com> Patch up several Sema::FindInstantiatedDecl() callers, so that they'll
properly cope with NULL return values.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127024 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
9a299e0575ce235f491014627c7267e2d2cd73de 04-Mar-2011 Douglas Gregor <dgregor@apple.com> Make sure to put template parameters into their owning template's
DeclContext once we've created it. This mirrors what we do for
function parameters, where the parameters start out with
translation-unit context and then are adopted by the appropriate
DeclContext when it is created. Also give template parameters public
access and make sure that they don't show up for the purposes of name
lookup.

Fixes PR9400, a regression introduced by r126920, which implemented
substitution of default template arguments provided in template
template parameters (C++ core issue 150).

How on earth could the DeclContext of a template parameter affect the
handling of default template arguments?

I'm so glad you asked! The link is
Sema::getTemplateInstantiationArgs(), which determines the outer
template argument lists that correspond to a given declaration. When
we're instantiating a default template argument for a template
template parameter within the body of a template definition (not it's
instantiation, per core issue 150), we weren't getting any outer
template arguments because the context of the template template
parameter was the translation unit. Now that the context of the
template template parameter is its owning template, we get the
template arguments from the injected-class-name of the owning
template, so substitution works as it should.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127004 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
b46ae3964ba02535276c71332396e9a7bad2dfa5 03-Mar-2011 Douglas Gregor <dgregor@apple.com> Fix PR9390 in not one, but two ways:

1) When we do an instantiation of the injected-class-name type,
provide a proper source location. This is just plain good hygiene.

2) When we're building a NestedNameSpecifierLoc from a CXXScopeSpec,
only return an empty NestedNameSpecifierLoc if there's no
representation.

Both problems contributed to the horrible test case in PR9390 that I
couldn't reduce down to something palatable.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126961 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
0cfaf6a270ecd0f5c7e541a8047c87948317548b 25-Feb-2011 Douglas Gregor <dgregor@apple.com> Push nested-name-specifier source location information into namespace
aliases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126496 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
db9924191092b4d426cc066637d81698211846aa 25-Feb-2011 Douglas Gregor <dgregor@apple.com> Push nested-name-specifier source location information into using directives.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126489 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
5149f37cfc736d03233bf92b5ba7c6e866c6647b 25-Feb-2011 Douglas Gregor <dgregor@apple.com> Maintain nested-name-specifier source-location information through
instantiation of using declarations (all three forms).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126485 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
c22b5fff39a7520207f165fb16a27a34b944bd9c 25-Feb-2011 Douglas Gregor <dgregor@apple.com> Use NestedNameSpecifierLoc within out-of-line variables, function, and
tag definitions. Also, add support for template instantiation of
NestedNameSpecifierLocs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126470 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
dc355713be51fcb4ee52d9fd6b4548ceff47fadf 25-Feb-2011 Douglas Gregor <dgregor@apple.com> Update UsingDecl, UnresolvedUsingTypenameDecl, and
UnresolvedUsingValueDecl to use NestedNameSpecifierLoc rather than the
extremely-lossy NestedNameSpecifier/SourceRange pair it used to use,
improving source-location information.

Various infrastructure updates to support NestedNameSpecifierLoc:
- AST/PCH (de-)serialization
- Recursive AST visitor
- libclang traversal (including the first tests of this
functionality)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126459 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
c34348a7ef1a6b3f92a644a227953800cd1f9947 24-Feb-2011 Douglas Gregor <dgregor@apple.com> Retain complete source-location information for C++
nested-name-specifiers throughout the parser, and provide a new class
(NestedNameSpecifierLoc) that contains a nested-name-specifier along
with its type-source information.

Right now, this information is completely useless, because we don't
actually store the source-location information anywhere in the
AST. Call this Step 1/N.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126391 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
9ddba32f25c0315cd3a6c7b63e0275b27cc1d973 24-Feb-2011 Douglas Gregor <dgregor@apple.com> Tweak the CXXScopeSpec API a bit, so that we require the
nested-name-specifier and source range to be set at the same time.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126347 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
34b41d939a1328f484511c6002ba2456db879a29 20-Feb-2011 Richard Smith <richard-llvm@metafoo.co.uk> Implement the C++0x deduced 'auto' feature.

This fixes PR 8738, 9060 and 9132.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126069 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
57ad37823e198f977cac605dbfbaefb4daf325e9 17-Feb-2011 Chris Lattner <sabre@nondot.org> Step #2/N of __label__ support: keep pushing LabelDecl forward,
making them be template instantiated in a more normal way and
make them handle attributes like other decls.

This fixes the used/unused label handling stuff, making it use
the same infrastructure as other decls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125771 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
d8e54990ade0dd5566f8e3aa2e62def08753d1e9 17-Feb-2011 Chris Lattner <sabre@nondot.org> Inline LocalInstantiationScope::getInstantiationOf into its one
client, making room for future hacking.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125770 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
f5ba7e089daadcd60b0f6e31d932be8bb6045281 14-Feb-2011 John McCall <rjmccall@apple.com> Change the context correctly when instantiating a static data member definition.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125517 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
eee1d5434ebfa955ffc3c493aecd68bb7b3f4838 14-Feb-2011 John McCall <rjmccall@apple.com> When parsing an out-of-line member function declaration, we must delay
access-control diagnostics which arise from the portion of the declarator
following the scope specifier, just in case access is granted by
friending the individual method. This can also happen with in-line
member function declarations of class templates due to templated-scope
friend declarations.

We were really playing fast-and-loose before with this sort of thing,
and it turned out to work because *most* friend functions are in file
scope. Making us delay regardless of context exposed several bugs with
how we were manipulating delay. I ended up needing a concept of a
context that's independent of the declarations in which it appears,
and then I actually had to make some things save contexts correctly,
but delay should be much cleaner now.

I also encapsulated all the delayed-diagnostics machinery in a single
subobject of Sema; this is a pattern we might want to consider rolling
out to other components of Sema.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125485 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
cde5a400dbc9655eddf0f383585d3cf67c11c539 01-Feb-2011 John McCall <rjmccall@apple.com> The code trying to assign a typedef to an anonymous tag declaration was
extremely rambunctious, both on parsing and on template instantiation.
Calm it down, fixing an internal consistency assert on anonymous enum
instantiation manglings.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124653 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
cb88a1f968c3d4eb451dafb421a8d9578edcbf1a 24-Jan-2011 Anders Carlsson <andersca@mac.com> Use attributes for all the override control specifiers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124122 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
c80e8115278ba1537c8b517a083ecbd0a018b579 21-Jan-2011 Peter Collingbourne <peter@pcc.me.uk> Sema: process non-inheritable attributes on function declarations early

This allows us to simplify the handling for the overloadable attribute,
removing a number of FIXMEs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123961 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
9eefa229dfb71400a6bbee326420a7f0e2e91f1f 20-Jan-2011 Anders Carlsson <andersca@mac.com> When instantiating member functions, propagate whether the member function is marked 'final' and 'override'.

Also, call CheckOverrideControl when instantiating member functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123900 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
6952f1e4256c5b43aee5e98cea4e9b663bd1d413 19-Jan-2011 Douglas Gregor <dgregor@apple.com> Implement support for non-type template parameter packs whose type is
a pack expansion, e.g., the parameter pack Values in:

template<typename ...Types>
struct Outer {
template<Types ...Values>
struct Inner;
};

This new implementation approach introduces the notion of an
"expanded" non-type template parameter pack, for which we have already
expanded the types of the parameter pack (to, say, "int*, float*",
for Outer<int*, float*>) but have not yet expanded the values. Aside
from creating these expanded non-type template parameter packs, this
patch updates template argument checking and non-type template
parameter pack instantiation to make use of the appropriate types in
the parameter pack.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123845 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
61f438ac38cb7ccd40e77861b19f34553694416f 19-Jan-2011 Douglas Gregor <dgregor@apple.com> NonTypeTemplateParmDecls always have TypeSourceInfo. There's no sense
in pretending otherwise.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123839 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
6a24bfda084f06a0b252b7befe8cbb17fce7f94e 14-Jan-2011 Douglas Gregor <dgregor@apple.com> Handle substitutions into function parameter packs whose patterns
contain multiple parameter packs at different levels.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123488 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
07a77b4b1d1fa95930129541eff8b79558f5d80d 14-Jan-2011 Douglas Gregor <dgregor@apple.com> When we're instantiating a direct variable initializer that has a pack
expansion in it, we may end up instantiating to an empty
expression-list. In this case, the variable is uninitialized; tweak
the instantiation logic to handle this case. Fixes PR8977.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123449 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
cded4f649cd4b7ba7d461c25c6482ef52b8d3a2a 14-Jan-2011 Douglas Gregor <dgregor@apple.com> Keep track of the number of expansions to be produced from a type pack
expansion, when it is known due to the substitution of an out
parameter pack. This allows us to properly handle substitution into
pack expansions that involve multiple parameter packs at different
template parameter levels, even when this substitution happens one
level at a time (as with partial specializations of member class
templates and the signatures of member function templates).

Note that the diagnostic we provide when there is an arity mismatch
between an outer parameter pack and an inner parameter pack in this
case isn't as clear as the normal diagnostic for an arity
mismatch. However, this doesn't matter because these cases are very,
very rare and (even then) only typically occur in a SFINAE context.

The other kinds of pack expansions (expression, template, etc.) still
need to support optional tracking of the number of expansions, and we
need the moral equivalent of SubstTemplateTypeParmPackType for
substituted argument packs of template template and non-type template
parameters.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123448 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
21371ea7cf647f4f0f783faac325925cb8febb1c 11-Jan-2011 Douglas Gregor <dgregor@apple.com> When mapping from a function parameter pack to the set of function
parameters it expanded to, map exactly the number of function
parameters that were expanded rather than just running to the end of
the instantiated parameter list. This finishes the implementation of
the last sentence of C++0x [temp.deduct.call]p1.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123213 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
7d5c0c1273bdc1cb3dff1cb5a62d07b1439e82c7 11-Jan-2011 Douglas Gregor <dgregor@apple.com> Implement the last bullet of [temp.deduct.type]p5 and part of the last
sentence of [temp.deduct.call]p1, both of which concern the
non-deducibility of parameter packs not at the end of a
parameter-type-list. The latter isn't fully implemented yet; see the
new FIXME.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123210 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
d3731198193eee92796ddeb493973b7a598b003e 10-Jan-2011 Douglas Gregor <dgregor@apple.com> Work-in-progress implementation of C++0x [temp.arg.explicit]p9, which
allows an argument pack determines via explicit specification of
function template arguments to be extended by further, deduced
arguments. For example:

template<class ... Types> void f(Types ... values);
void g() {
f<int*, float*>(0, 0, 0); // Types is deduced to the sequence int*, float*, int
}

There are a number of FIXMEs in here that indicate places where we
need to implement + test retained expansions, plus a number of other
places in deduction where we need to correctly cope with the
explicitly-specified arguments when deducing an argument
pack. Furthermore, it appears that the RecursiveASTVisitor needs to be
auditied; it's missing some traversals (especially w.r.t. template
arguments) that cause it not to find unexpanded parameter packs when
it should.

The good news, however, is that the tr1::tuple implementation now
works fully, and the tr1::bind example (both from N2080) is actually
working now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123163 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
cbb67480094b3bcb5b715acd827cbad55e2a204c 08-Jan-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Renamed CXXBaseOrMemberInitializer to CXXCtorInitializer. This is both shorter,
more accurate, and makes it make sense for it to hold a delegating constructor
call.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123084 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
91fc73e7ffb1fa1da0276518359d3bd4ed11c843 07-Jan-2011 Douglas Gregor <dgregor@apple.com> When instantiating the arguments to an initializer, use the
TreeTransform version of TransformExprs() rather than explicit loop,
so that we expand pack expansions properly. Test cast coming soon...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123014 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
12c9c00024a01819e3a70ef6d951d32efaeb9312 07-Jan-2011 Douglas Gregor <dgregor@apple.com> Implement substitution of a function parameter pack for its set of
instantiated function parameters, enabling instantiation of arbitrary
pack expansions involving function parameter packs. At this point, we
can now correctly compile a simple, variadic print() example:

#include <iostream>
#include <string>

void print() {}

template<typename Head, typename ...Tail>
void print(const Head &head, const Tail &...tail) {
std::cout << head;
print(tail...);
}

int main() {
std::string hello = "Hello";
print(hello, ", world!", " ", 2011, '\n');
}



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123000 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
61c4d28e36cd3f1be392cb77f07436d1fa6b0f9f 05-Jan-2011 Douglas Gregor <dgregor@apple.com> Implement support for template template parameter packs, e.g.,

template<template<class> class ...Metafunctions>
struct apply_to_each;



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122874 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
3fb9e4b89f72823f162096086f0f964e6dcf66d6 04-Jan-2011 Douglas Gregor <dgregor@apple.com> Implement pack expansion of base initializers, so that we can
initialize those lovely mixins that come from pack expansions of base
specifiers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122793 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
10738d36b150aa65206890c1c845cdba076e4200 24-Dec-2010 Douglas Gregor <dgregor@apple.com> Add an AST representation for non-type template parameter
packs, e.g.,

template<typename T, unsigned ...Dims> struct multi_array;

along with semantic analysis support for finding unexpanded non-type
template parameter packs in types, expressions, and so on.

Template instantiation involving non-type template parameter packs
probably doesn't work yet. That'll come soon.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122527 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
e02e26293cf8e3bad1059b39cea75c6582896da6 22-Dec-2010 Douglas Gregor <dgregor@apple.com> Implement template argument deduction for pack expansions whose
pattern is a template argument, which involves repeatedly deducing
template arguments using the pattern of the pack expansion, then
bundling the resulting deductions into an argument pack.

We can now handle a variety of simple list-handling metaprograms using
variadic templates. See, e.g., the new "count" metaprogram.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122439 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
b99268b3083c882103bd1bd08bdcc9a76a2b4795 21-Dec-2010 Douglas Gregor <dgregor@apple.com> Implement instantiation of pack expansions whose pattern is a type-id
in an exception specification.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122297 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
723df245307a530da5433dfb43accf187dc3e243 14-Dec-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added missing IgnoreParens().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121795 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
e23cf437fe76b1ed02d63c3f61b456fd48a915f5 14-Dec-2010 John McCall <rjmccall@apple.com> Restore r121752 without modification.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121763 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
5bfe232d1f07a6fd160fcf82c277c055a412a1c0 14-Dec-2010 John McCall <rjmccall@apple.com> Pull out r121752 in case it's causing the selfhost breakage.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121759 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
0e88aa7100da32acc63bc8a4dcb946ed517868f1 14-Dec-2010 John McCall <rjmccall@apple.com> Factor out most of the extra state in a FunctionProtoType into a separate
class to be passed around. The line between argument and return types and
everything else is kindof vague, but I think it's justifiable.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121752 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
140a2bd77539b4537010d8cd6a0a3805ce724b3e 13-Dec-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Skip ParenType on function instantiations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121720 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
40e17752086c2c497951d64f5ac6ab5039466113 09-Dec-2010 Francois Pichet <pichet2000@gmail.com> Fix PR8760: IndirectFieldDecl Type was not updated during template instantiation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121363 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
4765fa05b5652fcc4356371c2f481d0ea9a1b007 06-Dec-2010 John McCall <rjmccall@apple.com> Rename CXXExprWithTemporaries -> ExprWithCleanups; there's no theoretical
reason this is limited to C++, and it's certainly not limited to temporaries.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120996 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
00eb3f9c5b33e3d99aee1f8b75dd9c9678fdd66b 04-Dec-2010 Francois Pichet <pichet2000@gmail.com> More anonymous struct/union redesign. This one deals with anonymous field used in a constructor initializer list:

struct X {
X() : au_i1(123) {}
union {
int au_i1;
float au_f1;
};
};

clang will now deal with au_i1 explicitly as an IndirectFieldDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120900 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
a88cefd266c428be33cc06f7e8b00ff8fc97c1ff 03-Dec-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added struct/class syntactic info for c++0x scoped enum.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120828 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
6bb4dcb412d53d05a80017df81d41e447e2aa3ea 28-Nov-2010 Nico Weber <nicolasweber@gmx.de> Minor whitespace and comment fixes. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120266 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
2a5f99eb4e2af771faacfceb9f78e230129c5e5a 25-Nov-2010 Nick Lewycky <nicholas@mxc.ca> Tie DefineVTablesUsed() in with recursive function instantiation so that we emit
a useful template instantiation stack. Fixes PR8640.

This also causes a slight change to where the "instantianted from" note shows up
in truly esoteric cases (see the change to test/SemaCXX/destructor.cpp), but
that isn't directly the fault of this patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120135 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
87c2e121cf0522fc266efe2922b58091cd2e0182 21-Nov-2010 Francois Pichet <pichet2000@gmail.com> Major anonymous union/struct redesign.
A new AST node is introduced:
def IndirectField : DDecl<Value>;
IndirectFields are injected into the anonymous's parent scope and chain back to
the original field. Name lookup for anonymous entities now result in an
IndirectFieldDecl instead of a FieldDecl.
There is no functionality change, the code generated should be the same.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119919 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
7663f396651716c82280f8fdcf97ad8e27c1ce5a 20-Nov-2010 Nick Lewycky <nicholas@mxc.ca> A bundle of whitespace changes, separated out from the functional changes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119886 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
d65587f7a6d38965fa37158d3f57990a7faf3836 10-Nov-2010 Douglas Gregor <dgregor@apple.com> Instantiate class member template partial specialization declarations
in the order they occur within the class template, delaying
out-of-line member template partial specializations until after the
class has been fully instantiated. This fixes a regression introduced
by r118454 (itself a fix for PR8001).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118704 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
37574f55cd637340f651330f5cfda69742880d36 09-Nov-2010 Nick Lewycky <nicholas@mxc.ca> Don't lose track of previous-declarations when instantiating a class template.
Fixes PR8001.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118454 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
910f8008fea79120489a53593fe971b0b8a4a740 08-Nov-2010 Douglas Gregor <dgregor@apple.com> Remove broken support for variadic templates, along with the various
abstractions (e.g., TemplateArgumentListBuilder) that were designed to
support variadic templates. Only a few remnants of variadic templates
remain, in the parser (parsing template type parameter packs), AST
(template type parameter pack bits and TemplateArgument::Pack), and
Sema; these are expected to be used in a future implementation of
variadic templates.

But don't get too excited about that happening now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118385 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
a43064c7b721a51ab2c0d0ccdc4f84064aa7cecc 06-Nov-2010 Douglas Gregor <dgregor@apple.com> When searching for an instantiated declaration requires instantiation
of its parent context, be sure to update the parent-context pointer
after instantiation. Fixes two anonymous-union instantiation issues in
<rdar://problem/8635664>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118313 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
61139c561f1a2c872209e32ff9143487cebf4324 30-Oct-2010 Nick Lewycky <nicholas@mxc.ca> Preserve the template type parameter name when instantiating a templace.
Fixes PR8489.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117776 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
3fa5cae9b3812cab9fab6c042c3329bb70a3d046 26-Oct-2010 John McCall <rjmccall@apple.com> No really, we don't have a retain/release system for statements/expressions
anymore.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117357 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
5b629aa86c987f276d00453b6c9ab8424f7903fe 23-Oct-2010 John McCall <rjmccall@apple.com> Parse attributes on enumerators and instantiate attributes on enum decls.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117182 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
b41d899a6023385c00a61eb9dd3e44db9dc7994e 21-Oct-2010 Craig Silverstein <csilvers2000@yahoo.com> Pass TInfo to CXXDestructorDecl::Create(), just like we do for other
function decls.

Reviewed by rjmccall and nlewycky.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116979 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
c54d688c604d28dcb9ab8f92047837c10c8f9c61 19-Oct-2010 John McCall <rjmccall@apple.com> When instantiating a dependently-scoped friend function declaration,
we may need to complete the type before looking into it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116795 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
4eab39f0745fb1949dbb40c4145771b927888242 19-Oct-2010 John McCall <rjmccall@apple.com> Instantiate enclosing template parameter lists when instantiating friends.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116789 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
9a34edb710917798aa30263374f624f13b594605 19-Oct-2010 John McCall <rjmccall@apple.com> Redirect templated friend class decls to a new Sema callback and
construct an unsupported friend when there's a friend with a templated
scope specifier. Fixes a consistency crash, rdar://problem/8540527


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116786 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
1274ccd90aec0b205fc838c3d504821ccfb55482 09-Oct-2010 Douglas Gregor <dgregor@apple.com> Implement C++0x scoped enumerations, from Daniel Wallin! (and tweaked a
bit by me).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116122 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
1b398205267ea69f35230eea50e0225db22ebb7e 29-Sep-2010 Douglas Gregor <dgregor@apple.com> Fix handling of dependent nested namespace specifiers in UsingDecls
during template instantiation, from Martin Vejnar!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115051 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
85606ebf3dd1b5dd81a59ef25b5ad47627664774 28-Sep-2010 Douglas Gregor <dgregor@apple.com> Reinstate r114925 and r114929, both steps toward
<rdar://problem/8459981>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114984 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
2a674e8e443b7a3e77957078248fb52b3b1ec321 28-Sep-2010 Bill Wendling <isanbard@gmail.com> Temporarily revert 114929 114925 114924 114921. It looked like they (or at least
one of them) was causing a series of failures:

http://google1.osuosl.org:8011/builders/clang-x86_64-darwin10-selfhost/builds/4518

svn merge -c -114929 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114929 into '.':
U include/clang/Sema/Sema.h
U include/clang/AST/DeclCXX.h
U lib/Sema/SemaDeclCXX.cpp
U lib/Sema/SemaTemplateInstantiateDecl.cpp
U lib/Sema/SemaDecl.cpp
U lib/Sema/SemaTemplateInstantiate.cpp
U lib/AST/DeclCXX.cpp
svn merge -c -114925 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114925 into '.':
G include/clang/AST/DeclCXX.h
G lib/Sema/SemaDeclCXX.cpp
G lib/AST/DeclCXX.cpp
svn merge -c -114924 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114924 into '.':
G include/clang/AST/DeclCXX.h
G lib/Sema/SemaDeclCXX.cpp
G lib/Sema/SemaDecl.cpp
G lib/AST/DeclCXX.cpp
U lib/AST/ASTContext.cpp
svn merge -c -114921 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114921 into '.':
G include/clang/AST/DeclCXX.h
G lib/Sema/SemaDeclCXX.cpp
G lib/Sema/SemaDecl.cpp
G lib/AST/DeclCXX.cpp



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114933 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
e10288c1e9e06dbd715f47bfaa22ce5d65fdf096 28-Sep-2010 Douglas Gregor <dgregor@apple.com> Centralize the management of CXXRecordDecl::DefinitionData's
HasTrivialConstructor, HasTrivialCopyConstructor,
HasTrivialCopyAssignment, and HasTrivialDestructor bits in
CXXRecordDecl's methods. This completes all but the Abstract bit and
the set of conversion functions, both of which will require a bit of
extra work. The majority of <rdar://problem/8459981> is now
implemented (but not all of it).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114929 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
3019c444c672938c57f5573840071ecd73425ee7 17-Sep-2010 John McCall <rjmccall@apple.com> When emitting a new-expression inside a conditional expression,
the cleanup might not be dominated by the allocation code.
In this case, we have to store aside all the delete arguments
in case we need them later. There's room for optimization here
in cases where we end up not actually needing the cleanup in
different branches (or being able to pop it after the
initialization code).

Also make sure we only call this operator delete along the path
where we actually allocated something.

Fixes rdar://problem/8439196.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114145 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
c6dbc3fa467e2355b678a6b717534928048efcb2 12-Sep-2010 Douglas Gregor <dgregor@apple.com> Diagnose the instantiation of variables (including static data
members) with function type. Fixes PR8047.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113723 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
a1a04786cea2445759026edacd096abd1fbf4a05 09-Sep-2010 Douglas Gregor <dgregor@apple.com> Eliminate the comma locations from all of the Sema routines that deal
with comma-separated lists. We never actually used the comma
locations, nor did we store them in the AST, but we did manage to
waste time during template instantiation to produce fake locations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113495 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
030ef472f31709e175895853fcb43d61d09022c7 03-Sep-2010 Chandler Carruth <chandlerc@gmail.com> Fix PR7402 when it strikes via template instantiation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113019 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
7a126a474fdde06382b315b4e3d8ef0a21d4dc31 31-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Rename DeclContext::getLookupContext to getRedeclContext and change its semantics slightly. No functionality change in the absence of inline namespaces. Also, change a few places where inline namespaces actually make a difference to be prepared for them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112563 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
71b87e4fa6bfb47107b099135864f9024004a4c9 31-Aug-2010 Douglas Gregor <dgregor@apple.com> When template substitution into a template parameter reduces the level
of that parameter, reduce the level by the number of active template
argument lists rather than by 1. The number of active template
argument lists is only > 1 when we have a class template partial
specialization of a member template of a class template that itself is
a member template of another class template.

... and Boost.MSM does this. Fixes PR7669.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112551 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
77535dfde258765c056ef4c6786ef56cc48f0c76 31-Aug-2010 Gabor Greif <ggreif@gmail.com> zap tabs

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112541 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
ab297ac4d3f7c078a34c75493b840ef6b5801be3 30-Aug-2010 Gabor Greif <ggreif@gmail.com> fix dual aspect of PR8007,
namely when the friend function prototype is already used
at the point of the template definition that is supposed
to inject the friend function. Testcase verifies four
scenarios.
I would like receive some code review for this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112524 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
6a557d8f6b3d7a747a0b57960d4b86f05ba2e53c 28-Aug-2010 Gabor Greif <ggreif@gmail.com> simplify by relying on cascading operator->

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112373 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
13a8affbb87cdb869adabe2a6e5998559f2598c4 28-Aug-2010 Gabor Greif <ggreif@gmail.com> simplify

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112372 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
f312b1ea179f1c44371f9ee0cd0bc006f612de11 27-Aug-2010 John McCall <rjmccall@apple.com> One who seeks knowledge learns something new every day.
One who seeks the Tao unlearns something new every day.
Less and less remains until you arrive at non-action.
When you arrive at non-action,
nothing will be left undone.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112244 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
2d88708cbe4e4ec5e04e4acb6bd7f5be68557379 26-Aug-2010 John McCall <rjmccall@apple.com> Split out a header to hold APIs meant for the Sema implementation from Sema.h.
Clients of Sema don't need to know (for example) the list of diagnostics we
support.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112093 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
62c78d54bee499dd87f768f48b21c9b5ec15e516 25-Aug-2010 Chandler Carruth <chandlerc@gmail.com> Rename *PendingImplicitInstantiations to *PendingInstantiations. No
functionality changed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112040 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
58e390ef491c8fb11ae17445054ee09527b492d3 25-Aug-2010 Chandler Carruth <chandlerc@gmail.com> Support explicit instantiation of function templates and members of class
templates when only the declaration is in scope. This requires deferring the
instantiation to be lazy, and ensuring the definition is required for that
translation unit. We re-use the existing pending instantiation queue,
previously only used to track implicit instantiations which were required to be
lazy. Fixes PR7979.

A subsequent change will rename *PendingImplicitInstantiations to
*PendingInstatiations for clarity given its broader role.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112037 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
2a7fb27913999d132cf9e10e03dc5271faa2e9d3 25-Aug-2010 John McCall <rjmccall@apple.com> Move more stuff out of Sema.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112026 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
7cd088e519d7e6caa4c4c12db52e0e4ae35d25c2 24-Aug-2010 John McCall <rjmccall@apple.com> Struggle mightily against header inclusion in Sema.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111904 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
60d7b3a319d84d688752be3870615ac0f111fb16 24-Aug-2010 John McCall <rjmccall@apple.com> OwningExprResult -> ExprResult. This patch brought to you by
M-x query-replace-regexp
\(Sema::\|Action::\|Parser::\|\)Owning\(Expr\|Stmt\)Result -> \2Result



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111903 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
9ae2f076ca5ab1feb3ba95629099ec2319833701 24-Aug-2010 John McCall <rjmccall@apple.com> Kill off ExprArg (now just Expr*) and StmtArg (now just Stmt*).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111863 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
ca0408fb49c1370430672acf2d770b7151cf71de 23-Aug-2010 John McCall <rjmccall@apple.com> Sundry incremental steps towards killing off Action.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111795 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
d226f65006733ed7f709c3174f22ce33391cb58f 21-Aug-2010 John McCall <rjmccall@apple.com> DeclPtrTy -> Decl *



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111733 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
766724566289e6951a90b6483f0d3e22fe4b9b52 20-Aug-2010 John McCall <rjmccall@apple.com> Correctly instantiate templates with non-type template arguments that
are local externs. Fixes <rdar://problem/8302138>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111570 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
cf807c4dfdb23e8fa3f400e0b24ef5b79db7a530 19-Aug-2010 Sean Hunt <scshunt@csclub.uwaterloo.ca> Generate Attr subclasses with TableGen.

Now all classes derived from Attr are generated from TableGen.
Additionally, Attr* is no longer its own linked list; SmallVectors or
Attr* are used. The accompanying LLVM commit contains the updates to
TableGen necessary for this.

Some other notes about newly-generated attribute classes:

- The constructor arguments are a SourceLocation and a Context&,
followed by the attributes arguments in the order that they were
defined in Attr.td

- Every argument in Attr.td has an appropriate accessor named getFoo,
and there are sometimes a few extra ones (such as to get the length
of a variadic argument).

Additionally, specific_attr_iterator has been introduced, which will
iterate over an AttrVec, but only over attributes of a certain type. It
can be accessed through either Decl::specific_attr_begin/end or
the global functions of the same name.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111455 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
9b7d6701dabc24387cc152e4d13bf9aec6aa461a 18-Aug-2010 Chris Lattner <sabre@nondot.org> zap dead code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111365 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
de7a0fcdf9f30cb5a97aab614f3975d93cd9926f 15-Aug-2010 Eli Friedman <eli.friedman@gmail.com> Use Enumerators.data() instead of &Enumerators[0] to fix a potential
assertion failure.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111092 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
bbc6454bb98d6a6ecbaafa715222c5db834307f2 15-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Commit improved version of 111026 & 111027.

Unused warnings for functions:
-static functions
-functions in anonymous namespace
-class methods in anonymous namespace
-class method specializations in anonymous namespace
-function specializations in anonymous namespace

Unused warnings for variables:
-static variables
-variables in anonymous namespace
-static data members in anonymous namespace
-static data members specializations in anonymous namespace

Reveals lots of opportunities for dead code removal in llvm codebase that will
interest my esteemed colleagues.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111086 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
05eac86d547892847ca95b5350e28d681150fa68 13-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Revert 111026 & 111027, build breakage.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111036 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
30c0dd86f0dc3c1a1fba29581d04e8ed0bdb659d 13-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> The unused warnings extravaganza continues. Warn for:

-static variables
-variables in anonymous namespace (fixes rdar://7794535)
-static data members in anonymous namespace
-static data members specializations in anonymous namespace

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111027 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
f6d1d43d68016e975f22264343631a55b9701495 13-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Expand the unused warnings for functions. Warn for:

-static function declarations
-functions in anonymous namespace
-class methods in anonymous namespace
-class method specializations in anonymous namespace
-function specializations in anonymous namespace

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111026 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
e737f5041a36d0befb39ffeed8d50ba15916d3da 12-Aug-2010 Douglas Gregor <dgregor@apple.com> Move Sema's headers into include/clang/Sema, renaming a few along the way.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110945 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
ef3dce817d43faadbf21ce9102d33a9d84b02e09 12-Aug-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added locations and type source info for DeclarationName inside UsingDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110912 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
2577743c5650c646fb705df01403707e94f2df04 12-Aug-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added locations and type source info for DeclarationName.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110860 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
a834888ecc3ea36ea78a585209f422c7730d437a 06-Aug-2010 Nick Lewycky <nicholas@mxc.ca> Remove the DeclaredInCondition bit now that it's no longer used.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110432 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
1d8d1ccd36888f1120b3a1df9e76f35dc2edb81d 01-Aug-2010 John McCall <rjmccall@apple.com> Instantiate attributes from the pattern record when instantiating
a class template. Fixes rdar://problem/8243419.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109967 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
ff331c15729f7d4439d253c97f4d60f2a7ffd0c6 25-Jul-2010 Douglas Gregor <dgregor@apple.com> Remove the vast majority of the Destroy methods from the AST library,
since we aren't going to be calling them ever.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109377 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
2c853e401ca406d417eb916e867226050e7be06b 20-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Hide FunctionTemplateDecl's specializations folding set as implementation detail and introduce
FunctionTemplateDecl::findSpecialization.

Redeclarations of specializations will not cause the previous decl to be removed from the set,
the set will keep the canonical decl. findSpecialization will return the most recent redeclaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108834 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
cc0b1bc979b650a8a8b34b2032a074fd7724a90d 20-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Hide the specializations folding sets of ClassTemplateDecl as an implementation detail (InsertPos
leaks though) and add methods to its interface for adding/finding specializations.

Simplifies its users a bit and we no longer need to replace specializations in the folding set with
their redeclarations. We just return the most recent redeclarations.

As a bonus, it fixes http://llvm.org/PR7670.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108832 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
8a6c0f1a48b8167ca1457c9f05288fa637033dc9 18-Jul-2010 Peter Collingbourne <peter@pcc.me.uk> When instantiating function definitions set parameter names to those used in template

The rationale is that we are copying the entire definition including
parameter names which may differ between the declaration and the
definition.

This is particularly important if any parameters are unnamed in the
declaration, as a DeclRef to an unnamed ParmVarDecl would cause the
pretty printer to produce invalid output.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108643 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
55a17c057c5293e517609a91438342737ef51545 13-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> Set DeclContext of ParamVarDecl only. No need
to set that of VarDecl for block variables
(they are already set). Per Doug's comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108273 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
e7ffbe233ed04f921a008ed893672ee759d1a0ad 13-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> More block instantiation stuff. Set variable/param DeclContext
to block context when first instantiating them.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108266 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
8dd0c5626455cdf94280783e85e413eed6cbf3d9 13-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> Instantiate attributes when first building an instantiated
VarDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108218 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
cad8d31117800f804ee4f313134162edac8f8813 12-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> Copy over attributes to instantiated variable.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108195 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
24bae92f08ae098cc50a602d8cf1273b423e14da 08-Jul-2010 Douglas Gregor <dgregor@apple.com> When performing substitution of template arguments within the body of
a template, be sure to include the template arguments from the
injected-class-name. Fixes PR7587.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107895 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
06a54a38be5054c910ffc92db60edab23f9ea105 07-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce Decl::hasBody() and FunctionDecl::hasBody() and use them instead of getBody() when we are just checking the existence of a body, to avoid de-serialization of the body from PCH.

Makes de-serialization of the function body even more "lazier".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107768 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
4ced79f0971592e6e7122037de69ee9ae534ce72 25-Jun-2010 Chandler Carruth <chandlerc@gmail.com> Implement dependent alignment attribute support. This is a bit gross given the
current attribute system, but it is enough to handle class templates which
specify parts of their alignment in terms of their template parameters.

This also replaces the attributes test in SemaTemplate with one that actually
tests working attributes instead of broken ones. I plan to add more tests here
for non-dependent attributes in a subsequent patch.

Thanks to John for walking me through some of this. =D


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106818 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
c070cc602d6eefea881f71a60de09e05b54c3fdd 18-Jun-2010 Douglas Gregor <dgregor@apple.com> Given Decl::isUsed() a flag indicating when to consider the "used"
attribute as part of the calculation. Sema::MarkDeclReferenced(), and
a few other places, want only to consider the "used" bit to determine,
e.g, whether to perform template instantiation. Fixes a linkage issue
with Boost.Serialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106252 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
efed5c832de630715dd42211dd3b2aab5dd97a1b 16-Jun-2010 Douglas Gregor <dgregor@apple.com> Revert r106099; it broke self-host.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106100 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
6cd8087e66d706f2317865f86c865fd9bc6969c9 16-Jun-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added TemplateTypeParmType::getDecl().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106099 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
7cf84d66965a7706004d8590b5af5fe54b85f525 15-Jun-2010 Douglas Gregor <dgregor@apple.com> Implement -fvisibility-inlines-hidden. <rdar://problem/7819834>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106003 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
d92f7a297c0ed3f7d0ebcbb557e1d4c1925b8c72 09-Jun-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added inherited info to template and non-type arguments of templates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105716 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
6206d53f67613958ae1b023aba337ebb46f11a8b 05-Jun-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added AccessSpecDecl node.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105525 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
ea7b4880bc07cd99b3994c2a95d722a06ab56594 04-Jun-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Don't insert in lexical context implicit definitions of static member instances.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105465 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
9a55591af3e5506b95a9718e15380129fbfc5ebc 30-May-2010 Sean Hunt <rideau3@gmail.com> Convert DeclNodes to use TableGen.

The macros required for DeclNodes use have changed to match the use of
StmtNodes. The FooFirst enumerator constants have been named firstFoo
to match usage elsewhere.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105165 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
836adf6771d5170d936599dfcce21687e37e9bbf 24-May-2010 Douglas Gregor <dgregor@apple.com> Make sure that we instantiate variably modified types, even if they
aren't dependent. Fixes <rdar://problem/8020206>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104511 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
b212d9a8e10308cde5b7a1ce07bd59d8df14fa06 21-May-2010 Douglas Gregor <dgregor@apple.com> When instantiating a function declaration within a function template,
be sure to merge its parameter scope with its parent's scope. Fixes
PR7184.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104386 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
9901c57806f7e36736ed1616e6ab3eebcc99b78c 21-May-2010 Douglas Gregor <dgregor@apple.com> When instantiating anonymous structs/unions within a function, make
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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104305 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
4469e8a97cdca3725b4f8f366916143113c029ac 19-May-2010 Douglas Gregor <dgregor@apple.com> Revert r104106; it's breaking linking of Boost.Serialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104121 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
7d2bcc74fd32875b737dabe3b4f867fe4c907ca0 19-May-2010 Douglas Gregor <dgregor@apple.com> Teach clang to instantiate attributes on more declarations. Fixes PR7102.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104106 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
238058c372cfb7bdaf489f51171eb1380ebfd6a6 18-May-2010 Douglas Gregor <dgregor@apple.com> I hate this commit.

Revert much of the implementation of C++98/03 [temp.friend]p5 in
r103943 and its follow-ons r103948 and r103952. While our
implementation was technically correct, other compilers don't seem to
implement this paragraph (which forces the instantiation of friend
functions defined in a class template when a class template
specialization is instantiated), and doing so broke a bunch of Boost
libraries.

Since this behavior has changed in C++0x (which instantiates the
friend function definitions when they are used), we're going to skip
the nowhere-implemented C++98/03 semantics and go straight to the
C++0x semantics.

This commit is a band-aid to get Boost up and running again. It
doesn't really fix PR6952 (which this commit un-fixes), but it does
deal with the way Boost.Units abuses this particular paragraph.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104014 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
a6b0907a71c66e6bf65e2477a6f9783d9fec4d47 18-May-2010 Douglas Gregor <dgregor@apple.com> Instantiate attributes on typedefs. This is a quick fix for PR7148,
when we really need a proper audit of our handling of attributes in
templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103999 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
cfe833be882f600206f1587f157b025b368497d7 17-May-2010 Douglas Gregor <dgregor@apple.com> Diagnose a redefinition error when there are two instantiations of friend
functions defined inside a class template. Fixes PR6952, the last
Boost.Units failure.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103952 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
6cfacfe54c75baa4d67f1fbdf4f80644b662818e 17-May-2010 Douglas Gregor <dgregor@apple.com> Determine when the instantiation of a friend function defined inside a
class template conflicts with an existing (non-template)
definition. This is another part of PR6952.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103948 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
ac7c2c8a9d47df7d652364af3043c41816a18fa4 17-May-2010 Douglas Gregor <dgregor@apple.com> C++98/03 [temp.friend]p4 requires that inline function definitions
within class templates be instantiated along with each class template
specialization, even if the functions are not used. Do so, as a baby
step toward PR6952.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103943 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
9679cafc6368cceed1a5e69d3038d0316401b352 12-May-2010 Douglas Gregor <dgregor@apple.com> Whenever we instantiate a function definition or class, enter a new
potentially-evaluated expression context, to ensure that used
declarations get properly marked. Fixes PR7123.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103624 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
5764f613e61cb3183f3d7ceeafd23396de96ed16 09-May-2010 Douglas Gregor <dgregor@apple.com> Improve our handling of the -Wunused-variable warning in templates. In
particular, don't complain about unused variables that have dependent
type until instantiation time, so that we can look at the type of the
variable. Moreover, only complain about unused variables that have
neither a user-declared constructor nor a non-trivial destructor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103362 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
b4eeaff1595b7d0a8fbc2b3c8bec7dc63f48b7fd 08-May-2010 Douglas Gregor <dgregor@apple.com> When we encounter a non-dependent type during template instantiation,
mark any declarations we see inside of that type as
"referenced". Fixes PR7079.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103323 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
13c8577201e4fc0ddac5f09d05fd1778832137d1 06-May-2010 Douglas Gregor <dgregor@apple.com> Partial and full specializations of a class template may have a
different tag kind ("struct" vs. "class") than the primary template,
which has an affect on access control.

Should fix the last remaining Boost.Accumulors failure.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103144 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
5f970eee81372dfc6a1457c3d6d052af04e32a38 04-May-2010 Douglas Gregor <dgregor@apple.com> When instantiating a function that was declared via a typedef, e.g.,

typedef int functype(int, int);
functype func;

also instantiate the synthesized function parameters for the resulting
function declaration.

With this change, Boost.Wave builds and passes all of its regression
tests.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103025 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
e7089b0c6ffe8a8854150b60df00fb544099f77d 04-May-2010 Douglas Gregor <dgregor@apple.com> When computing the template arguments for the instantiation of a
friend function template, be sure to adjust the computed template
argument lists based on the location of the definition of the function
template: it's possible that the definition we're instantiating with
and the template declaration that we found when creating the
specialization are in different contexts, which meant that we would
end up using the wrong template arguments for instantiation.

Fixes PR7013; all Boost.DynamicBitset tests now pass.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102974 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
f7d72f5a4a3f0e610d77c6779ca3c21920a14bc7 03-May-2010 Douglas Gregor <dgregor@apple.com> When instantiating a function-local variable definition, introduce the
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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102945 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
6920cdce298ac9ba50dc7ebb7dea982a300b0664 03-May-2010 Douglas Gregor <dgregor@apple.com> When instantiating a member function declared via a typedef, don't try
to enter the instantiated parameter declarations into the local
instantiation scope; they can't be referenced anyway. Fixes PR7022.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102914 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
895162da2d52f4243f61081d7436de66af4503fc 30-Apr-2010 Douglas Gregor <dgregor@apple.com> Clean up our handling of local instantiation scopes, which keep track
of the mapping from local declarations to their instantiated
counterparts during template instantiation. Previously, we tried to do
some unholy merging of local instantiation scopes that involved
storing a single hash table along with an "undo" list on the
side... which was ugly, and never handled function parameters
properly.

Now, we just keep separate hash tables for each local instantiation
scope, and "combining" two scopes means that we'll look in each of the
combined hash tables. The combined scope stack is rarely deep, and
this makes it easy to avoid the "undo" issues we were hitting. Also,
I've simplified the logic for function parameters: if we're declaring
a function and we need the function parameters to live longer, we just
push them back into the local instantiation scope where we need them.

Fixes PR6990.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102732 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
dc60c1eb4acbde6edcec9760de92f9098593d915 30-Apr-2010 Douglas Gregor <dgregor@apple.com> Introduce a sequence number into class template partial
specializations, which keeps track of the order in which they were
originally declared. We use this number so that we can always walk the
list of partial specializations in a predictable order during matching
or template instantiation. This also fixes a failure in Boost.Proto,
where SourceManager::isBeforeInTranslationUnit was behaving
poorly in inconsistent ways.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102693 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
31f17ecbef57b5679c017c375db330546b7b5145 27-Apr-2010 John McCall <rjmccall@apple.com> Make the InjectedClassNameType the canonical type of the current instantiation
of a class template or class template partial specialization. That is to
say, in
template <class T> class A { ... };
or
template <class T> class B<const T*> { ... };
make 'A<T>' and 'B<const T*>' sugar for the corresponding InjectedClassNameType
when written inside the appropriate context. This allows us to track the
current instantiation appropriately even inside AST routines. It also allows
us to compute a DeclContext for a type much more efficiently, at some extra
cost every time we write a template specialization (which can be optimized,
but I've left it simple in this patch).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102407 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
76d326448d7e4c10b2896edc2ee855d1e68d1b88 24-Apr-2010 John McCall <rjmccall@apple.com> Recommit r102215, this time being more careful to only set the "principal
declaration" (i.e. the only which will actually be looked up) to have the
non-member-operator bit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102231 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
f0bf4d554f2513cbb4bec952c81ced59279ad91e 24-Apr-2010 Devang Patel <dpatel@apple.com> Revert r102215. This causes clang crash while compiling a test case from gdb testsuite.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102224 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
f88b0d6c99e6473e78331271935986535dc4603c 23-Apr-2010 John McCall <rjmccall@apple.com> Transition the last acceptable-result filter kind in LookupResult over to use
a simple IDNS mask by introducing a namespace for non-member operators.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102215 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
d57a38ee02c285d69d05fed6df0d7406b2517888 23-Apr-2010 Douglas Gregor <dgregor@apple.com> When instantiating a typedef of an anonymous tag type, note in the tag
declaration that this typedef gives the tag a name. Fixes a problem
uncovered by Boost.GIL (Generic Image Library).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102180 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
16573fa9705b546b7597c273b25b85d6321e2b33 20-Apr-2010 Douglas Gregor <dgregor@apple.com> Keep track of the actual storage specifier written on a variable or
function declaration, since it may end up being changed (e.g.,
"extern" can become "static" if a prior declaration was static). Patch
by Enea Zaffanella and Paolo Bolzoni.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101826 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
cb27b0f70d2017295776afafe3616e0bcd74ab51 12-Apr-2010 Douglas Gregor <dgregor@apple.com> Be sure to instantiate the parameters of a function, even when the
function's type is (strictly speaking) non-dependent. This ensures
that, e.g., default function arguments get instantiated properly.

And, since I couldn't resist, collapse the two implementations of
function-parameter instantiation into calls to a single, new function
(Sema::SubstParmVarDecl), since the two had nearly identical code (and
each had bugs the other didn't!). More importantly, factored out the
semantic analysis of a parameter declaration into
Sema::CheckParameter, which is called both by
Sema::ActOnParamDeclarator (when parameters are parsed) and when a
parameter is instantiated. Previously, we were missing some
Objective-C and address-space checks on instantiated function
parameters.

Fixes PR6733.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101029 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
6cd3b9fb8a29bb70fff01719bdde238723d67c10 09-Apr-2010 John McCall <rjmccall@apple.com> Instantiate default argument expressions even if their associated parameter
type isn't dependent. Fixes rdar://problem/7838962.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100871 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
ea7390c7b384ce607bfc8fc13c01f37cfc3776f0 08-Apr-2010 John McCall <rjmccall@apple.com> Set access properly on instantiated friend class template declarations.
Fixes PR6752.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100806 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
c53d0d762010217d02da5aa14be171817d63e3fe 08-Apr-2010 Douglas Gregor <dgregor@apple.com> Introduce an egregious hack to work around a bug in libstdc++ 4.2.x's
<tr1/hashtable> header, where a friend class template
std::tr1::__detail::_Map_base is declared with the wrong template
parameters. GCC doesn't catch the problem, so Clang does a little
back-flip to avoid diagnosing just this one instance of the problem.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100790 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
af2094e7cecadf36667deb61a83587ffdd979bd3 08-Apr-2010 John McCall <rjmccall@apple.com> Implement dependent friend function template specializations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100753 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
06245bfb3ae40bb24a8bfb17eafeb266a4daf5ca 07-Apr-2010 Douglas Gregor <dgregor@apple.com> Improve handling of friend types in several ways:
- When instantiating a friend type template, perform semantic
analysis on the resulting type.
- Downgrade the errors concerning friend type declarations that do
not refer to classes to ExtWarns in C++98/03. C++0x allows
practically any type to be befriended, and ignores the friend
declaration if the type is not a class.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100635 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
1eabb7d0c30f6a876b0fd03ad4656c096c26b8d0 01-Apr-2010 Douglas Gregor <dgregor@apple.com> Improve diagnostics when an elaborated-type-specifer containing a
nested-name-specifier (e.g., "class T::foo") fails to find a tag
member in the scope nominated by the
nested-name-specifier. Previously, we gave a bland

error: 'Nested' does not name a tag member in the specified scope

which didn't actually say where we were looking, which was rather
horrible when the nested-name-specifier was instantiated. Now, we give
something a bit better:

error: no class named 'Nested' in 'NoDepBase<T>'




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100060 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
264ba48dc98f3f843935a485d5b086f7e0fdc4f1 30-Mar-2010 Rafael Espindola <rafael.espindola@gmail.com> the big refactoring bits of PR3782.

This introduces FunctionType::ExtInfo to hold the calling convention and the
noreturn attribute. The next patch will extend it to include the regparm
attribute and fix the bug.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99920 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
b0cb022daec8671406ab25f4b5d5a6d48d823bc4 27-Mar-2010 John McCall <rjmccall@apple.com> Implement method friends in class templates and fix a few related problems.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99708 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
b1a56e767cfb645fcb25027ab728dd5824d92615 27-Mar-2010 John McCall <rjmccall@apple.com> Put function templates instantiated from friend declarations in the correct
lexical context. This is required for ADL to work properly; fixes PR6716.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99665 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
d325daa506338ab86f9dd468b48fd010673f49a6 26-Mar-2010 John McCall <rjmccall@apple.com> Reapply r99596 with a fix: link an instantiated friend function to its
pattern if it has a body.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99610 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
a7bc8559b40a78d664d6c7faf4b42ff21184c146 26-Mar-2010 John McCall <rjmccall@apple.com> Apparently that didn't work. Reverting for now.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99601 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
d7e29e114d20da5b83e0cb7bc29ec717a7458cb1 26-Mar-2010 John McCall <rjmccall@apple.com> Properly instantiate and link in friend function templates.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99596 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
32f2fb53d9d7c28c94d8569fd0fcf06cccee0c3d 25-Mar-2010 John McCall <rjmccall@apple.com> Preserve type-source information in friend declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99525 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
93ba8579c341d5329175f1413cdc3b35a36592d2 25-Mar-2010 John McCall <rjmccall@apple.com> Properly instantiate friend class template declarations and link them into
the redeclaration chain. Recommitted from r99477 with a fix: we need to
merge in default template arguments from previous declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99496 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
e131c574c7baa28eb0759181478d710a2aa60cb6 25-Mar-2010 Bob Wilson <bob.wilson@apple.com> Revert 99477 since it appears to be breaking the clang-x86_64-darwin10-fnt
buildbot. The tramp3d test fails.
--- Reverse-merging r99477 into '.':
U test/SemaTemplate/friend-template.cpp
U test/CXX/temp/temp.decls/temp.friend/p1.cpp
U lib/Sema/SemaTemplateInstantiateDecl.cpp
U lib/Sema/SemaAccess.cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99481 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
a56623b01ed9f28f10416432d147c7a1729d5f1d 25-Mar-2010 John McCall <rjmccall@apple.com> Properly instantiate and link in friend-class-template declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99477 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
28329e511854fdd3b31561b2690f91f9e6a6402e 24-Mar-2010 Douglas Gregor <dgregor@apple.com> When pulling apart an initializer that involves a CXXConstructExpr, do
not pick apart a CXXTemporaryObjectExpr because such an object
construction was explicitly written in the source code. Fixes PR6657.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99427 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
0c01d18094100db92d38daa923c95661512db203 24-Mar-2010 John McCall <rjmccall@apple.com> Implement a framework for the delay of arbitrary diagnostics within
templates. So delay access-control diagnostics when (for example) the target
of a friend declaration is a specific specialization of a template.

I was surprised to find that this was required for an access-controlled selfhost.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99383 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
b6217665c6a987f2d6c8665fd70365d7719ac4df 15-Mar-2010 John McCall <rjmccall@apple.com> Remember declaration scope qualifiers in the AST. Imposes no memory overhead
on unqualified declarations.

Patch by Enea Zaffanella! Minimal adjustments: allocate the ExtInfo nodes
with the ASTContext and delete them during Destroy(). I audited a bunch of
Destroy methods at the same time, to ensure that the correct teardown was
being done.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98540 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
21ef0fa27b0783ec0bc6aa5b524feb2ec840f952 11-Mar-2010 John McCall <rjmccall@apple.com> Maintain type source information for functions through template
instantiation. Based on a patch by Enea Zaffanella! I found a way to
reduce some of the redundancy between TreeTransform's "standard"
FunctionProtoType transformation and TemplateInstantiator's override,
and I killed off the old SubstFunctionType by adding type source info
for the last cases where we were creating FunctionDecls without TSI
(at least that get passed through template instantiation).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98252 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
3cb0ebd5f76abcb776f7cb4062bd79e3268c0dc4 10-Mar-2010 John McCall <rjmccall@apple.com> Create a new InjectedClassNameType to represent bare-word references to the
injected class name of a class template or class template partial specialization.
This is a non-canonical type; the canonical type is still a template
specialization type. This becomes the TypeForDecl of the pattern declaration,
which cleans up some amount of code (and complicates some other parts, but
whatever).

Fixes PR6326 and probably a few others, primarily by re-establishing a few
invariants about TypeLoc sizes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98134 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
6b98b2e5f33ce2dcdb7fa385f7e21672d49f1a69 02-Mar-2010 Douglas Gregor <dgregor@apple.com> Unify initializer-instantiation code for variable declarations and
base/member initializers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97560 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
449d0a829007ea654912098e6a73134a2c529d61 01-Mar-2010 Douglas Gregor <dgregor@apple.com> When looking for a redeclaration of a static variable, only look for redeclarations. Fixes PR6449

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97478 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
96084f171f4824397dc48453146f0a9719cb9247 01-Mar-2010 Douglas Gregor <dgregor@apple.com> When instantiating a function-scoped enum, make sure that it and its
enumeration constants get placed into the local instantiation hash
table. Fixes PR6375.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97471 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
00225547b51b42f7400eed36475b6672418a1151 01-Mar-2010 Douglas Gregor <dgregor@apple.com> Robustify instantiation of templates when there are errors in the
template definition. Do this both by being more tolerant of errors in
our asserts and by not dropping a variable declaration completely when
its initializer is ill-formed. Fixes the crash-on-invalid in PR6375,
but not the original issue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97463 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
7c1e98f1cb37b40e619a0c8aee8b337f037b432b 01-Mar-2010 Douglas Gregor <dgregor@apple.com> When looking for the instantiated declaration that corresponds to a
given declaration in a template, make sure that the context we're
searching through is complete. Fixes PR6376.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97444 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
2fa98001f832836e3f652c211a9d2f80501d659a 16-Feb-2010 Douglas Gregor <dgregor@apple.com> Do not try to instantiate invalid declarations. It's a recipe for
disaster. Fixes PR6161.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96371 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
3dbd3d5c04cd5abd7dfd83b15f51d7c610a3c512 16-Feb-2010 John McCall <rjmccall@apple.com> Support local namespace aliases and permit them to be instantiated.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96335 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
291b441a095b289c30d9f311fe37a2cf5ed6fd45 13-Feb-2010 Chandler Carruth <chandlerc@gmail.com> Skip implicit instantiation of templated variables where a more recent
redeclaration provides an explicit instantiation or is invalid.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96097 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
838db383b69b9fb55f55c8e9546477df198a4faa 11-Feb-2010 Douglas Gregor <dgregor@apple.com> Eliminate a bunch of unnecessary ASTContexts from members functions of
Decl subclasses. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95841 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
60c93c9981c467738369702e7aa23fd58c2b6aac 09-Feb-2010 Douglas Gregor <dgregor@apple.com> Migrate the mish-mash of declaration checks in
Sema::ActOnUninitializedDecl over to InitializationSequence (with
default initialization), eliminating redundancy. More importantly, we
now check that a const definition in C++ has an initilizer, which was
an #if 0'd code for many, many months. A few other tweaks were needed
to get everything working again:

- Fix all of the places in the testsuite where we defined const
objects without initializers (now that we diagnose this issue)
- Teach instantiation of static data members to find the previous
declaration, so that we build proper redeclaration
chains. Previously, we had the redeclaration chain but built it
too late to be useful, because...
- Teach instantiation of static data member definitions not to try
to check an initializer if a previous declaration already had an
initializer. This makes sure that we don't complain about static
const data members with in-class initializers and out-of-line
definitions.
- Move all of the incomplete-type checking logic out of
Sema::FinalizeDeclaratorGroup; it makes more sense in
ActOnUnitializedDecl.

There may still be a few places where we can improve these
diagnostics. I'll address that as a separate commit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95657 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
63644fae3970d4146200e4cb25dd9aace34a3398 07-Feb-2010 Douglas Gregor <dgregor@apple.com> Workaround for friend template instantiation crash in PR5848, from Keir Mierle!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95517 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
68b6b87b6beb7922fc2c8ab923ba2ce125490363 06-Feb-2010 John McCall <rjmccall@apple.com> Teach Sema how to instantiate a local function declaration properly. Fixes
PR 5517.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95470 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
8b013bdbf6474ed25d4017635cac851e51163c25 05-Feb-2010 Douglas Gregor <dgregor@apple.com> Cope with finding the "instantiated" declaration when we are
type-checking within a template definition. In this case, the
"instantiated" declaration is just the declaration itself, found
within the current instantiation. Fixes PR6239.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95442 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
6d3e627dacdb2f749195635ab587fd067ef813e1 05-Feb-2010 Douglas Gregor <dgregor@apple.com> Fix two issues with the substitution of template template parameters
when instantiating the declaration of a member template:
- Only check if the have a template template argument at a specific position
when we already know that we have template arguments at that level;
otherwise, we're substituting for a level-reduced template template
parameter.
- When trying to find an instantiated declaration for a template
template parameter, look into the instantiated scope. This was a
typo, where we had two checks for TemplateTypeParmDecl, one of
which should have been a TemplateTemplateParmDecl.

With these changes, tramp3d-v4 passes -fsyntax-only.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95421 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
a89ebea6bd68d8333f2d020106a3640831aa6507 03-Feb-2010 Douglas Gregor <dgregor@apple.com> Look through CXXExprWithTemporaries when digging out the original
initializer. Grrr....


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95211 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
9db7dbb918ca49f4ee6c181e4917e7b6ec547353 31-Jan-2010 Douglas Gregor <dgregor@apple.com> Rework base and member initialization in constructors, with several
(necessarily simultaneous) changes:

- CXXBaseOrMemberInitializer now contains only a single initializer
rather than a set of initialiation arguments + a constructor. The
single initializer covers all aspects of initialization, including
constructor calls as necessary but also cleanup of temporaries
created by the initializer (which we never handled
before!).

- Rework + simplify code generation for CXXBaseOrMemberInitializers,
since we can now just emit the initializer as an initializer.

- Switched base and member initialization over to the new
initialization code (InitializationSequence), so that it

- Improved diagnostics for the new initialization code when
initializing bases and members, to match the diagnostics produced
by the previous (special-purpose) code.

- Simplify the representation of type-checked constructor initializers in
templates; instead of keeping the fully-type-checked AST, which is
rather hard to undo at template instantiation time, throw away the
type-checked AST and store the raw expressions in the AST. This
simplifies instantiation, but loses a little but of information in
the AST.

- When type-checking implicit base or member initializers within a
dependent context, don't add the generated initializers into the
AST, because they'll look like they were explicit.

- Record in CXXConstructExpr when the constructor call is to
initialize a base class, so that CodeGen does not have to infer it
from context. This ensures that we call the right kind of
constructor.

There are also a few "opportunity" fixes here that were needed to not
regress, for example:

- Diagnose default-initialization of a const-qualified class that
does not have a user-declared default constructor. We had this
diagnostic specifically for bases and members, but missed it for
variables. That's fixed now.

- When defining the implicit constructors, destructor, and
copy-assignment operator, set the CurContext to that constructor
when we're defining the body.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94952 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
3b85ecf2049c8670eba30d0c06f28f64168af9b8 23-Jan-2010 John McCall <rjmccall@apple.com> Preserve access for enum constants during template instantiation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94333 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
7a9813ced7455b8a33a807489ca77a4f809c8a73 22-Jan-2010 John McCall <rjmccall@apple.com> Create function, block, and template parameters in the context of the
translation unit. This is temporary for function and block parameters;
template parameters can just stay this way, since Templates aren't
DeclContexts. This gives us the nice property that everything created
in a record DC should have access in C++.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94122 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
46460a68f6508775e98c19b4bb8454bb471aac24 20-Jan-2010 John McCall <rjmccall@apple.com> First pass at collecting access-specifier information along inheritance paths.
Triggers lots of assertions about missing access information; fix them.

Will actually consume this information soon.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94038 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
ab8bbf4ebd3e3e6eab913cb044772a62b7581941 18-Jan-2010 Douglas Gregor <dgregor@apple.com> Encoding calling conventions in the type system, from Charles Davis!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93726 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
60406bede202b66ebdd98cac0c38d20f9698aeca 16-Jan-2010 Douglas Gregor <dgregor@apple.com> Introduce a second queue of "local" pending implicit instantiation,
which are instantiations of the member functions of local
classes. These implicit instantiations have to occur at the same time
as---and in the same local instantiation scope as---the enclosing
function, since the member functions of the local class can refer to
locals within the enclosing function. This should really, really fix PR5764.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93666 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
79c2278a66d8fc0943774d1b7c71a32f7764e1e2 16-Jan-2010 Douglas Gregor <dgregor@apple.com> When we are instantiating a member function of a local class, be sure
to merge the local instantiation scope with the outer local
instantiation scope, so that we can instantiate declarations from the
function owning the local class. Fixes an assert while instantiating
Boost.MPL's BOOST_MPL_ASSERT_MSG.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93651 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
5126fd0dd92c4ec211c837ee78d5ce59c68dcbd5 30-Dec-2009 John McCall <rjmccall@apple.com> Typedefs can be redeclared. That seems like something we should record in
the AST lest we run into some crazy canonicalization bug like PR5874.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92283 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
7557a1348d2821dce126a778aa7acd7a00b814fd 24-Dec-2009 Douglas Gregor <dgregor@apple.com> Egregious, disgusting workaround for PR5866. We need to rework how we
keep track of friends within templates, which will provide a real for
PR5866. For now, this makes sure we don't do something entirely stupid
with friends of specializations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92143 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
323c310efa0abd7a786b0303501186b5f33eb8d7 22-Dec-2009 John McCall <rjmccall@apple.com> Add using shadow decls to the "instantiated locals" map, fixing PR5847.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91928 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
e129d44aab6324aa2094d68730a7843c41a4e45f 18-Dec-2009 John McCall <rjmccall@apple.com> Patch over yet more problems with friend declarations which were provoking
problems on LLVM-Code-Syntax. This proved remarkably easy to "fix" once
I settled on how I was going to approach it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91633 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
6c1c1b8c6ca743a5b6b4c81f9ac56392c12c7457 15-Dec-2009 John McCall <rjmccall@apple.com> Link up member-class redeclarations during template instantiation.
This test courtesy of LLVM.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91462 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
e976ffe18ee60b81641423f42ff6feec2f5e3cb7 15-Dec-2009 John McCall <rjmccall@apple.com> Fix PR5716 by bandaging over the solution until we can come back to it.
I apologize for friend declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91359 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
6eef519fc8a97bb7ca6066f23d35e10f06b2c1b5 14-Dec-2009 Douglas Gregor <dgregor@apple.com> Improve template instantiation for object constructions in several ways:

- During instantiation, drop default arguments from constructor and
call expressions; they'll be recomputed anyway, and we don't want
to instantiate them twice.
- Rewrote the instantiation of variable initializers to cope with
non-dependent forms properly.

Together, these fix a handful of problems I introduced with the switch
to always rebuild expressions from the source code "as written."



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91315 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
a88cfbfac9bbcbb9858f048d6d73a48711d8e93d 12-Dec-2009 Douglas Gregor <dgregor@apple.com> Rework the way we handle template instantiation for
implicitly-generated AST nodes. We previously built instantiated nodes
for each of these AST nodes, then passed them on to Sema, which was
not prepared to see already-type-checked nodes (see PR5755). In some
places, we had ugly workarounds to try to avoid re-type-checking
(e.g., in VarDecl initializer instantiation).

Now, we skip implicitly-generated nodes when performing instantiation,
preferring instead to build just the AST nodes that directly reflect
what was written in the source code. This has several advantages:

- We don't need to instantiate anything that doesn't have a direct
correlation to the source code, so we can have better location
information.
- Semantic analysis sees the same thing at template instantiation
time that it would see for a non-template.
- At least one ugly hack (VarDecl initializers) goes away.

Fixes PR5755.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91218 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
9f54ad4381370c6b771424b53d219e661d6d6706 10-Dec-2009 John McCall <rjmccall@apple.com> Implement redeclaration checking and hiding semantics for using declarations. There
are a couple of O(n^2) operations in this, some analogous to the usual O(n^2)
redeclaration problem and some not. In particular, retroactively removing
shadow declarations when they're hidden by later decls is pretty unfortunate.
I'm not yet convinced it's worse than the alternative, though.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91045 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
0ae7b3f1d5403265f693ed75384603ca8fbba74d 08-Dec-2009 Douglas Gregor <dgregor@apple.com> Implement template instantiation for exception specifications. Also,
print exception specifications on function types and
declarations. Fixes <rdar://problem/7450999>.

There is some poor source-location information here, because we don't
track locations of the types in exception specifications. Filed PR5719.

Failures during template instantiation of the signature of a function
or function template have wrong point-of-instantiation location
information. I'll tackle that with a separate commit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90863 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
604e7f14d672af80ca5b9044f30f3dc23d37ddd5 08-Dec-2009 John McCall <rjmccall@apple.com> Correctly implement the C++03 and 0x restrictions on class-member using
declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90843 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
a93c934af4fbf97cbe8e649d82e68ccacfe57c95 07-Dec-2009 John McCall <rjmccall@apple.com> DeclaratorInfo -> TypeSourceInfo. Makes an effort to rename associated variables,
but the results are imperfect.

For posterity, I did:

cat <<EOF > $cmdfile
s/DeclaratorInfo/TypeSourceInfo/g
s/DInfo/TInfo/g
s/TypeTypeSourceInfo/TypeSourceInfo/g
s/SourceTypeSourceInfo/TypeSourceInfo/g
EOF

find lib -name '*.cpp' -not -path 'lib/Parse/*' -exec sed -i '' -f $cmdfile '{}' \;
find lib -name '*.h' -exec sed -i '' -f $cmdfile '{}' \;
find include -name '*.h' -not -path 'include/clang/Parse/*' -not -path 'include/clang/Basic/*' -exec sed -i '' -f $cmdfile '{}' \;



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90743 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
ed97649e9574b9d854fa4d6109c9333ae0993554 04-Dec-2009 John McCall <rjmccall@apple.com> Fix "using typename" and the instantiation of non-dependent using declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90614 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
e7184df728bb339633d88c774b5097dd9318cc8a 03-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> A new helper function to set various bits in the class when
a new virtual function is declared/instantiated. it is used
in couple of places.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90470 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
1f5f3a4d58a1c7c50c331b33329fc14563533c04 03-Dec-2009 Douglas Gregor <dgregor@apple.com> When we're building a CXXExprWithTemporaries, only include those
temporaries that are within our current evaluation context. That way,
nested evaluation contexts (e.g., within a sizeof() expression) won't
see temporaries from outer contexts. Also, make sure to push a new
evaluation context when instantiating the initializer of a variable;
this may be an unevaluated context or a potentially-evaluated context,
depending on whether it's an in-class initializer or not. Fixes PR5672.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90460 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
802ab45fea51beff12f386329d4928811a479c6e 02-Dec-2009 Douglas Gregor <dgregor@apple.com> Improve source location information for C++ member initializers in a
constructor, by keeping the DeclaratorInfo* rather than just the type
and a single location.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90355 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
e6342c06356976508525145a6ba433d05f893171 01-Dec-2009 Douglas Gregor <dgregor@apple.com> Funtion templates and function template specializations do not
override virtual functions. Also, eliminate a (now redundant) call to
AddOverriddenMethods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90242 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
4ba3136b3eb9740a07bd61d0ab23ce9a8d894dee 01-Dec-2009 Douglas Gregor <dgregor@apple.com> Move the checking of overridden virtual functions into the code path
common to both parsing and template instantiation, so that we'll find
overridden virtuals for member functions of class templates when they
are instantiated.

Additionally, factor out the checking for pure virtual functions, so
that it will be executed both at parsing time and at template
instantiation time.

These changes fix PR5656 (for real), although one more tweak
w.r.t. member function templates will be coming along shortly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90241 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
7dafdf51176d2f52e3a27f1ef70161ea2133ff52 30-Nov-2009 John McCall <rjmccall@apple.com> Remove all of Sema's explicit uses of OverloadedFunctionDecl except for
those associated with TemplateNames.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90162 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
85b4521e34dcd4a0a4a1f0819e1123128e5a3125 28-Nov-2009 Benjamin Kramer <benny.kra@googlemail.com> Remove remaining VISIBILITY_HIDDEN from anonymous namespaces.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90044 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
a244dc3a554f6bf82416697e34f9e96dc1efbb88 24-Nov-2009 Anders Carlsson <andersca@mac.com> Fix a crash when "instantiating" VarDecls that are neither type nor value dependent.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89774 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
d5532b6cfff2977e0c59fa6ead7f7973984a620d 23-Nov-2009 John McCall <rjmccall@apple.com> Encapsulate "an array of TemplateArgumentLocs and two angle bracket locations" into
a new class. Use it pervasively throughout Sema.

My fingers hurt.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89638 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
6826314938f8510cd1a6b03b5d032592456ae27b 18-Nov-2009 John McCall <rjmccall@apple.com> Overhaul previous-declaration and overload checking to work on lookup results
rather than NamedDecl*. This is a major step towards eliminating
OverloadedFunctionDecl.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89263 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
a165da09c0313309d2d4dda42d0b2d4096a372a1 18-Nov-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Track overriding methods when instantiating a template class. Fixes PR5550.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89248 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
7d384dd5ace9ae9a22a69e700d2cacb256bc6c69 18-Nov-2009 John McCall <rjmccall@apple.com> Split LookupResult into its own header.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89199 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
7ba107a1863ddfa1664555854f0d7bdb3c491c92 18-Nov-2009 John McCall <rjmccall@apple.com> Incremental progress on using declarations. Split UnresolvedUsingDecl into
two classes, one for typenames and one for values; this seems to have some
support from Doug if not necessarily from the extremely-vague-on-this-point
standard. Track the location of the 'typename' keyword in a using-typename
decl. Make a new lookup result for unresolved values and deal with it in
most places.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89184 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
48c32a7e7c977f317dc1dc19524c2f54d29c7270 17-Nov-2009 Douglas Gregor <dgregor@apple.com> Implement template instantiation for using directives, which is dead simple.

Also, make the "don't know how to instantiate a particular kind of
declaration" diagnostic nicer, so we don't have to trap Clang in a
debugger to figure out what went wrong.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89050 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
9488ea120e093068021f944176c3d610dd540914 17-Nov-2009 John McCall <rjmccall@apple.com> Instead of hanging a using declaration's target decls directly off the using
decl, create shadow declarations and put them in scope like normal.
Work in progress.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89048 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
a24dc2e38c7fb0f7f138b3d14b5f0f241fd0eccf 17-Nov-2009 John McCall <rjmccall@apple.com> Carry lookup configuration throughout lookup on the LookupResult. Give
LookupResult RAII powers to diagnose ambiguity in the results. Other diagnostics
(e.g. access control and deprecation) will be moved to automatically trigger
during lookup as part of this same mechanism.

This abstraction makes it much easier to encapsulate aliasing declarations
(e.g. using declarations) inside the lookup system: eventually, lookup will
just produce the aliases in the LookupResult, and the standard access methods
will naturally strip the aliases off.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89027 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
66724ea67d7d598b937d86fa66f03f09a1c758f3 14-Nov-2009 Douglas Gregor <dgregor@apple.com> If we attempt to add a constructor template specialization that looks
like a copy constructor to the overload set, just ignore it. This
ensures that we don't try to use such a constructor as a copy
constructor *without* triggering diagnostics at the point of
declaration.

Note that we *do* diagnose such copy constructors when explicitly
written by the user (e.g., as an explicit specialization).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88733 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
fd47648b5d351ff6d1a3e886e1c3d10712ba4675 14-Nov-2009 Douglas Gregor <dgregor@apple.com> Revert r88718, which does NOT solve the constructor-template-as-copy-constructor issue. Big thanks to John for finding this

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88724 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
cad84b7c12564ff37feb66d6d004bb609bea8788 14-Nov-2009 Douglas Gregor <dgregor@apple.com> A constructor template cannot be instantiated to a copy
constructor. Make sure that such declarations can never be formed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88718 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
f35f828f9883123772a9731af190a608f3236ef4 11-Nov-2009 Douglas Gregor <dgregor@apple.com> Improve diagnostics when a default template argument does not match
with its corresponding template parameter. This can happen when we
performed some substitution into the default template argument and
what we had doesn't match any more, e.g.,

template<int> struct A;
template<typename T, template<T> class X = A> class B;

B<long> b;

Previously, we'd emit a pretty but disembodied diagnostic showing how
the default argument didn't match the template parameter. The
diagnostic was good, but nothing tied it to the *use* of the default
argument in "B<long>". This commit fixes that.

Also, tweak the counting of active template instantiations to avoid
counting non-instantiation records, such as those we create for
(surprise!) checking default arguments, instantiating default
arguments, and performing substitutions as part of template argument
deduction.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86884 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
9148c3f5829f4d031249faeb1043e7be914539e8 11-Nov-2009 Douglas Gregor <dgregor@apple.com> Before checking a template template argument against its corresponding
template template parameter, substitute any prior template arguments
into the template template parameter. This, for example, allows us to
properly check the template template argument for a class such as:

template<typename T, template<T Value> class X> struct Foo;

The actual implementation of this feature was trivial; most of the
change is dedicated to giving decent diagnostics when this
substitution goes horribly wrong. We now get a note like:

note: while substituting prior template arguments into template
template parameter 'X' [with T = float]

As part of this change, enabled some very pedantic checking when
comparing template template parameter lists, which shook out a bug in
our overly-eager checking of default arguments of template template
parameters. We now perform only minimal checking of such default
arguments when they are initially parsed.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86864 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
9106ef78f8fcc9df1a60c7a5b64c7d967194207e 11-Nov-2009 Douglas Gregor <dgregor@apple.com> Instantiation of template template parameters for nested templates, e.g.,

template<typename T>
struct X {
template<template<T Value> class Y> struct Inner;
};



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86844 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
0f8716b7bb25d61a82f699b3975167451f7b5a68 09-Nov-2009 Douglas Gregor <dgregor@apple.com> Improve instantiation of default template arguments for nested
templates. The instantiation of these default arguments must be (and
now, is) delayed until the template argument is actually used, at
which point we substitute all levels of template arguments
concurrently.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86578 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
e48319a8a901bc915d48d02b99c62e5f2589dbd9 09-Nov-2009 Douglas Gregor <dgregor@apple.com> When transforming an InitListExpr, if we already computed a non-dependent type for the InitListExpr, keep it

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86559 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
bb4a33cdf6342110811ae16f7ca6accababf432f 09-Nov-2009 Eli Friedman <eli.friedman@gmail.com> Add hack to make the given testcase work. As far as I can tell, this change is
reasonably safe, but it doesn't seem like the right solution.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86508 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
42dddbeadb82a918d83c14bdcce47ba8c0ed6fba 08-Nov-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Don't reprocess non-dependent initializers of non-dependent VarDecls. Fixes PR5426.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86460 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
d8fe2d56fb5463c9d109e8c6dab2e98b06bee186 07-Nov-2009 Anders Carlsson <andersca@mac.com> When instantiating a field decl, make sure to clone its attributes. With this change FileCheck no longer crashes when it's run without any arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86344 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
cf3293eaeb3853d12cff47e648bbe835004e929f 01-Nov-2009 Douglas Gregor <dgregor@apple.com> When determining whether a reference to a static data member is an
integral constant expression, make sure to find where the initializer
was provided---inside or outside the class definition---since that can
affect whether we have an integral constant expression (and, we need
to see the initializer itself).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85741 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
550d9b28fd586db541eb6dd36f3c10d114e483d8 31-Oct-2009 Douglas Gregor <dgregor@apple.com> Implement "incremental" template instantiation for non-type template
parameters and template type parameters, which occurs when
substituting into the declarations of member templates inside class
templates. This eliminates errors about our inability to "reduce
non-type template parameter depth", fixing PR5311.

Also fixes a bug when instantiating a template type parameter
declaration in a member template, where we weren't properly reducing
the template parameter's depth.

LLVM's StringSwitch header now parses.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85669 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
259571e27e513cfaf691cc7447e09b31a47d5438 30-Oct-2009 Douglas Gregor <dgregor@apple.com> When a friend is declared in a dependent context, don't even try to
match it up with a declaration in the outer scope.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85628 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
e8c01bdb56549adcecd71ce39160eea54b2c51c8 30-Oct-2009 Douglas Gregor <dgregor@apple.com> Instantiate class template friends better; fixes PR5332.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85612 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
833ca991c1bfc967f0995974ca86f66ba1f666b5 29-Oct-2009 John McCall <rjmccall@apple.com> Track source information for template arguments and template specialization
types. Preserve it through template instantiation. Preserve it through PCH,
although TSTs themselves aren't serializable, so that's pretty much meaningless.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85500 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
ed9c0f90b7e0811c209b95e39fe07c211c531285 29-Oct-2009 Douglas Gregor <dgregor@apple.com> Implement support for semantic checking and template instantiation of
class template partial specializations of member templates. Also,
fixes a silly little bug in the marking of "used" template parameters
in member templates. Fixes PR5236.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85447 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
7ced9c8529b734e313f62a3b81189d6f402f6713 27-Oct-2009 Douglas Gregor <dgregor@apple.com> Introduce FunctionDecl::isInlined() to tell whether a function should
be inlined.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85307 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
0130f3cc4ccd5f46361c48d5fe94133d74619424 27-Oct-2009 Douglas Gregor <dgregor@apple.com> Rename FunctionDecl::isInline/setInline to
FunctionDecl::isInlineSpecified/setInlineSpecified.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85305 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
3b846b6c252972a6f142aa226c1e65aebd0feeca 27-Oct-2009 Douglas Gregor <dgregor@apple.com> Explicit instantiation suppresses the instantiation of non-inline
function template specializations and member functions of class
template specializations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85300 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
0d03514da06dffb39a260a1228ea3fd01d196fa4 27-Oct-2009 Douglas Gregor <dgregor@apple.com> An explicit instantiation definition only instantiations those class
members that have a definition. Also, use
CheckSpecializationInstantiationRedecl as part of this instantiation
to make sure that we diagnose the various kinds of problems that can
occur with explicit instantiations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85270 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
ba6a9bd384df475780be636ca45bcef5c5bbd19f 24-Oct-2009 John McCall <rjmccall@apple.com> Preserve type source information in TypedefDecls. Preserve it across
template instantiation. Preserve it through PCH. Show it off to the indexer.

I'm healthily ignoring the vector type cases because we don't have a sensible
TypeLoc implementation for them anyway.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84994 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
33642df30088f2ddb0b22c609523ab8df9dff595 24-Oct-2009 Douglas Gregor <dgregor@apple.com> Implement template instantiation for non-type template
parameters. Fixes PR5103.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84979 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
58e4677a948e80c92deeebbcd3bdd9266adda798 23-Oct-2009 John McCall <rjmccall@apple.com> Remove OriginalTypeParmDecl; the original type is the one specified
in the DeclaratorInfo, if one is present.

Preserve source information through template instantiation. This is made
more complicated by the possibility that ParmVarDecls don't have DIs, which
is possibly worth fixing in the future.

Also preserve source information for function parameters in ObjC method
declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84971 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
07fb6bef6242c0f2ab47f059583edbdef924823e 23-Oct-2009 John McCall <rjmccall@apple.com> Preserve type source information when substituting into FieldDecls.
Just r84734 now that some fundamental work has been completed.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84914 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
3c50bfe3d9d4bda4183a541d97ec5b32bbae7aab 21-Oct-2009 John McCall <rjmccall@apple.com> Revert those last two commits. Beware the treacherous semicolon.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84736 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
1dc9acdb06dbd5f0a5747dd0ffa7ede680d7ca08 21-Oct-2009 John McCall <rjmccall@apple.com> Preserve type source information when substituting into ParmVarDecls.

Apparently I'm grinding my commit count.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84735 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
71e2bf960105daeb3b6f7005e73885b790b2a1b1 21-Oct-2009 John McCall <rjmccall@apple.com> Preserve type source information when substituting into FieldDecls.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84734 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
0a5fa06a688e1086ea553a24b42b9915996ed1f7 21-Oct-2009 John McCall <rjmccall@apple.com> Preserve source information when substituting into VarDecls.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84733 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
583f33b8a9227bace1a77a15404b4c64dc619d69 15-Oct-2009 Douglas Gregor <dgregor@apple.com> Make sure that we're diagnosing duplicate explicit instantiation definitions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84189 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
e2d3a3de71b2fa35614cb732a6da95a41fa38ad9 15-Oct-2009 Douglas Gregor <dgregor@apple.com> Diagnose explicit instantiations of function templates and member
functions/static data members of class template specializations that
do not have definitions. This is the latter part of [temp.explicit]p4;
the former part still needs more testing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84182 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
1028c9f0afc1cc5f4951b39b7067fa57c1fea07b 14-Oct-2009 Douglas Gregor <dgregor@apple.com> Give explicit and implicit instantiations of static data members of
class templates the proper linkage.

Daniel, please look over the CodeGenModule bits.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84140 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
663b5a0be7261c29bc4c526a71cffcfa02d4153e 14-Oct-2009 Douglas Gregor <dgregor@apple.com> Testing and some minor fixes for explicit template instantiation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84129 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
fd056bc86a8b22a9421b5d921bbca276d0f9d0f7 13-Oct-2009 Douglas Gregor <dgregor@apple.com> When explicitly specializing a member that is a template, mark the
template as a specialization. For example, this occurs with:

template<typename T>
struct X {
template<typename U> struct Inner { /* ... */ };
};

template<> template<typename T>
struct X<int>::Inner {
T member;
};

We need to treat templates that are member specializations as special
in two contexts:

- When looking for a definition of a member template, we look
through the instantiation chain until we hit the primary template
*or a member specialization*. This allows us to distinguish
between the primary "Inner" definition and the X<int>::Inner
definition, above.
- When computing all of the levels of template arguments needed to
instantiate a member template, don't add template arguments
from contexts outside of the instantiation of a member
specialization, since the user has already manually substituted
those arguments.

Fix up the existing test for p18, which was actually wrong (but we
didn't diagnose it because of our poor handling of member
specializations of templates), and add a new test for member
specializations of templates.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83974 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
a735b206fdb5c15767a45289e1ffb3b568f70f2b 13-Oct-2009 Douglas Gregor <dgregor@apple.com> Improve the internal representation and semantic analysis of friend
function templates.

This commit ensures that friend function templates are constructed as
FunctionTemplateDecls rather than partial FunctionDecls (as they
previously were). It then implements template instantiation for friend
function templates, injecting the friend function template only when
no previous declaration exists at the time of instantiation.

Oh, and make sure that explicit specialization declarations are not
friends.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83970 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
f0510d49a6985e9284d30cfc36a0df2a6292a638 13-Oct-2009 Douglas Gregor <dgregor@apple.com> When declaring a class template whose name is qualified, make sure
that the scope in which it is being declared is complete. Also, when
instantiating a member class template's ClassTemplateDecl, be sure to
delay type creation so that the resulting type is dependent. Ick.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83923 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
37d68185088947322a97eabdc1c0714b0debd929 13-Oct-2009 Douglas Gregor <dgregor@apple.com> Permit explicit specialization of member functions of class templates
that are declarations (rather than definitions). Also, be sure to set
the access specifiers properly when instantiating the declarations of
member function templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83911 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
f36e02d4aff98bf2e52e342e0038d4172fbb5e64 09-Oct-2009 John McCall <rjmccall@apple.com> Refactor the LookupResult API to simplify most common operations. Require users to
pass a LookupResult reference to lookup routines. Call out uses which assume a single
result.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83674 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
f6b1185f0a8a209c06dfc1efdb6a59cc851e970c 08-Oct-2009 Douglas Gregor <dgregor@apple.com> Improve checking for specializations of member classes of class
templates, and keep track of how those member classes were
instantiated or specialized.

Make sure that we don't try to instantiate an explicitly-specialized
member class of a class template, when that explicit specialization
was a declaration rather than a definition.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83547 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
251b4ff2578e26959a4c036140ccd61c5e9292f2 08-Oct-2009 Douglas Gregor <dgregor@apple.com> For instantiations of static data members of class templates, keep
track of the kind of specialization or instantiation. Also, check the
scope of the specialization and ensure that a specialization
declaration without an initializer is not a definition.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83533 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
2db323294ac02296125e1e0beb4c3595992e75bb 08-Oct-2009 Douglas Gregor <dgregor@apple.com> Keep track of whether a member function instantiated from a member
function of a class template was implicitly instantiated, explicitly
instantiated (declaration or definition), or explicitly
specialized. The same MemberSpecializationInfo structure will be used
for static data members and member classes as well.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83509 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
7974c3b7062f85bb7c0ada34526cdefe1d30f89b 07-Oct-2009 Douglas Gregor <dgregor@apple.com> Class template partial specializations can be declared anywhere that
its definition may be defined, including in a class.

Also, put in an assertion when trying to instantiate a class template
partial specialization of a member template, which is not yet
implemented.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83469 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
0d696533420fca4cf32694621e3edf582ad4d06e 28-Sep-2009 Douglas Gregor <dgregor@apple.com> Properly match instantiations of member function templates to the function templates from which they were instantiated

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82969 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
0ed093069ae9b000278a2df01f372438d9c63ec1 25-Sep-2009 Douglas Gregor <dgregor@apple.com> Sigh. Be *really* careful when copying a default function argument during template instantiation

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82761 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
f43d0b37c1d3f529d0f206e786ae6de61c5f364a 25-Sep-2009 Douglas Gregor <dgregor@apple.com> Be careful about copying uninstantiated default arguments during template instantiation

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82760 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
183700f494ec9b6701b6efe82bcb25f4c79ba561 22-Sep-2009 John McCall <rjmccall@apple.com> Change all the Type::getAsFoo() methods to specializations of Type::getAs().
Several of the existing methods were identical to their respective
specializations, and so have been removed entirely. Several more 'leaf'
optimizations were introduced.

The getAsFoo() methods which imposed extra conditions, like
getAsObjCInterfacePointerType(), have been left in place.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82501 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
e95b40961302c2130968ddfc3ba162e138f2118e 16-Sep-2009 Douglas Gregor <dgregor@apple.com> Teach Sema::FindInstantiatedDecl to find instantiated RecordDecls even
when we are not instantiating the corresponding "current
instantiation." This happens, e.g., when we are instantiating a
declaration reference that refers into the "current instantiation" but
occurs in a default function argument. The libstdc++ vector default
constructor now instantiates properly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82069 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
bf4ea56cdc376cef5a12abf6bf18dc34805c2226 15-Sep-2009 Douglas Gregor <dgregor@apple.com> Implement partial ordering of class template partial specializations
(C++ [temp.class.order]).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81866 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
52604ab71a74b8ec481255dfeea7dc9dba63b1a5 11-Sep-2009 Douglas Gregor <dgregor@apple.com> Slight improvement for extern templates, so that an explicit
instantiation definition can follow an explicit instantiation
declaration. This is as far as I want to go with extern templates now,
but they will still need quite a bit more work to get all of the C++0x
semantics right.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81573 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
1eb4433ac451dc16f4133a88af2d002ac26c58ef 09-Sep-2009 Mike Stump <mrs@apple.com> Remove tabs, and whitespace cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
d0e3daf2b980b505e535d35b432c938c6d0208ef 05-Sep-2009 Douglas Gregor <dgregor@apple.com> Improve the AST representation and semantic analysis for extern
templates. We now distinguish between an explicit instantiation
declaration and an explicit instantiation definition, and know not to
instantiate explicit instantiation declarations. Unfortunately, there
is some remaining confusion w.r.t. instantiation of out-of-line member
function definitions that causes trouble here.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81053 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
f4b5f5c6a1487317aab9aa30d97bccfd57c82c98 02-Sep-2009 Anders Carlsson <andersca@mac.com> Fix a codegen crash when a class template has a constructor that does member initialization of an anonymous union.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80826 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
72f6d678c8de9f3a770e8ae5fc4979abf3940668 01-Sep-2009 Douglas Gregor <dgregor@apple.com> In CXXBaseOrMemberInitializer, don't confuse CtorTocall with
AnonUnionMember. Fixes PR4826.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80721 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
44c73848d5d5bd34c05582dc8398a20bea7cd971 01-Sep-2009 Douglas Gregor <dgregor@apple.com> Implement proper substitution for OverloadedFunctionDecls, but substituting each of the functions in the overload set

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80692 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
cdc83c777973fa56b6f828bfe88210290ca58d62 01-Sep-2009 Anders Carlsson <andersca@mac.com> Don't assume that a base is always a RecordType, it can also be a TemplateSpecializationType. Also, make sure to get the instantiated union member.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80662 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
c17fb7bd9a06b027c792c7dfad7e9fa430277aff 01-Sep-2009 Anders Carlsson <andersca@mac.com> Add pretty stack traces when instantiating functions and static data members.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80661 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
9988d5d9ad0850e455bd413b03ba7dc8ecee5999 01-Sep-2009 Anders Carlsson <andersca@mac.com> Handle member initializers that point to fields in anonymous structs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80659 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
d8b285fee4471f393da8ee30f552ceacdc362afa 01-Sep-2009 Anders Carlsson <andersca@mac.com> Don't assert when instantiating member references to fields in anonymous structs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80657 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
ab88d97734f1260402a0c6a8f6b77bed7ed4e295 01-Sep-2009 John McCall <rjmccall@apple.com> Fix bug 4784 and allow friend declarations to properly extend
existing declaration chains.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80636 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
af496acbae62ad51bf42b40eea8ea8ebe48c5dbb 30-Aug-2009 Eli Friedman <eli.friedman@gmail.com> Unbreak tests. I'll look into why this is necessary later.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80468 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
c5573a81a83c4173c92c7e91b01371b7223d88c4 30-Aug-2009 Eli Friedman <eli.friedman@gmail.com> Make instantiating initializers for classes with a dependent base type
work correctly.

The change in lib/AST/DeclCXX.cpp is mostly a large reindentation; I
couldn't figure out a good way to avoid it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80446 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
0d8df780aef1acda5962347a32591efc629b6748 29-Aug-2009 Anders Carlsson <andersca@mac.com> Improve instantiation of UnresolvedUsingDecls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80434 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
52a575a5ce7b27b6612357cdba5aa4ec1574ad5e 29-Aug-2009 John McCall <rjmccall@apple.com> Fix the breakage by handling indirect instantiations. This would be much
improved if there were a consistent name for getInstantiatedFromMemberX()
across all classes. Cheap refactor if someone wants to do it, but let's get the
buildbots happy first.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80425 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
090253155017b7eec031bbd7bf07824a448e1d7a 29-Aug-2009 Anders Carlsson <andersca@mac.com> Instantiate member and base initializers. Patch by Anders Johnsen! (tweaked slightly by me)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80422 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
5fee110ac106370f75592df024001de73edced2a 29-Aug-2009 John McCall <rjmccall@apple.com> For consistency, just make friend declarations AS_public.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80420 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
f181d8a44f5837213eeaee6d71f584b1ab2849cd 29-Aug-2009 John McCall <rjmccall@apple.com> Ensure code generation for friend declarations in class templates.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80418 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
ed656469895ab77177669abe1611dbef8d33b90f 29-Aug-2009 Douglas Gregor <dgregor@apple.com> Remove #if 0'd code that is clearly not needed

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80399 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
a5bf7f13d7772b164750997f95ab18487bbc4114 29-Aug-2009 Douglas Gregor <dgregor@apple.com> Don't crash when instantiating templates containing anonymous structs/unions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80397 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
5ec178ff237d77e7acf5e747c19bf4f2de77a779 28-Aug-2009 Douglas Gregor <dgregor@apple.com> Fix and test template instantiation for nested member templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80394 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
d6350aefb1396b299e199c7f1fe51bb40c12e75e 28-Aug-2009 Douglas Gregor <dgregor@apple.com> Implement template instantiation for member class templates.

When performing template instantiation of the definitions of member
templates (or members thereof), we build a data structure containing
the template arguments from each "level" of template
instantiation. During template instantiation, we substitute all levels
of template arguments simultaneously.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80389 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
0dde18e5a713bc186062ca1ebc9967500b07faee 28-Aug-2009 Anders Carlsson <andersca@mac.com> Instantiate unresolved using declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80366 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
02cace78cf48cc26686bd5b07c78606abca13bcd 28-Aug-2009 John McCall <rjmccall@apple.com> Omnibus friend decl refactoring. Instead of cloning AST classes for friend
declarations of same, introduce a single AST class and add appropriate bits
(encoded in the namespace) for whether a decl is "real" or not. Much hackery
about previously-declared / not-previously-declared, but it's essentially
mandated by the standard that friends alter lookup, and this is at least
fairly non-intrusive.

Refactor the Sema methods specific to friends for cleaner flow and less nesting.

Incidentally solve a few bugs, but I remain confident that we can put them back.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80353 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
eaba1af8529c381d7bfd4dd0a8b48d2c01647972 27-Aug-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR4794 (instantiating friend class decl); this version shouldn't
cause any regressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80277 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
c5c54f2c7bbc000dbcaee5e0acec2dbb0c0f0cf8 27-Aug-2009 Eli Friedman <eli.friedman@gmail.com> PR4794: Make instantiating friend class decls not crash.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80272 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
d60e105e6d1624da647ef7dd35a9cf6fad1b763e 27-Aug-2009 Douglas Gregor <dgregor@apple.com> Implement instantiation of the declarations of member function
templates within class templates, producing a member function template
of a class template specialization. If you can parse that, I'm
sorry. Example:

template<typename T>
struct X {
template<typename U> void f(T, U);
};

When we instantiate X<int>, we now instantiate the declaration
X<int>::f, which looks like this:

template<typename U> void X<int>::f(int, U);

The path this takes through
TemplateDeclInstantiator::VisitCXXMethodDecl is convoluted and
ugly, but I don't know how to improve it yet. I'm resting my hopes on
the multi-level substitution required to instantiate definitions of
nested templates, which may simplify this code as well.

More testing to come...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80252 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
e9f8eb64ed2d41c23db4a9774768613d4e07a865 27-Aug-2009 Douglas Gregor <dgregor@apple.com> Make sure to bump the reference count of the last element in the ParenListExpr representing the direct initializer of a declaration

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80177 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
83ddad3ab513f5d73698cf9fbeb4ed3f011bc3b9 26-Aug-2009 Douglas Gregor <dgregor@apple.com> Implement support for C++ direct initializers that involve dependent
types or type-dependent expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80143 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
ce3ff2bd3a3386dbc209d3cba4b8769173b274c1 26-Aug-2009 John McCall <rjmccall@apple.com> Clarify the difference between substitution and instantiation by renaming
functions that don't instantiate definitions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80037 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
9351c173cd538f7f7c28af1494ac7e68b815b0e8 25-Aug-2009 Anders Carlsson <andersca@mac.com> Basic support for default argument expressions for function templates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79972 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
65ec1fda479688d143fe2403242cd9c730c800a1 22-Aug-2009 Douglas Gregor <dgregor@apple.com> Implement conversion function templates, along with the ability to use
template argument deduction from a conversion function (C++
[temp.deduct.conv]) with implicit conversions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79693 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
17e32f30e2d1eaf6639d3d4e2196a8d7c709fbac 22-Aug-2009 Douglas Gregor <dgregor@apple.com> Refactor instantiation of destructors to use the common CXXMethodDecl
code, fixing a problem where instantiations of out-of-line destructor
definitions would had the wrong lexical context.

Introduce tests for out-of-line definitions of the constructors,
destructors, and conversion functions of a class template partial
specialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79682 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
dec06664a1c4d8984251083db2215875aea1c80d 21-Aug-2009 Douglas Gregor <dgregor@apple.com> Introduce support for constructor templates, which can now be declared
and will participate in overload resolution. Unify the instantiation
of CXXMethodDecls and CXXConstructorDecls, which had already gotten
out-of-sync.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79658 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
a5d82000f7b173a0a5ce34dc8c09a03f98d9e439 21-Aug-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove TypeSpecStartLocation from VarDecl/FunctionDecl/FieldDecl, and use DeclaratorInfo to get this information.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79584 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
6b906869527be40b0d38d755e9ef51b331b88162 21-Aug-2009 Douglas Gregor <dgregor@apple.com> Implement support for calling member function templates, which involves:
- Allowing one to name a member function template within a class
template and on the right-hand side of a member access expression.
- Template argument deduction for calls to member function templates.
- Registering specializations of member function templates (and
finding them later).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79581 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
e29ba20148e9b7835ad463b39cd4ee9223eafbbf 20-Aug-2009 John McCall <rjmccall@apple.com> Basic nested-template implementation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79504 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
a1d5662d96465f0fddf8819d245da4d19b892eff 19-Aug-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce DeclaratorDecl and pass DeclaratorInfo through the Decl/Sema interfaces.

DeclaratorDecl contains a DeclaratorInfo* to keep type source info.
Subclasses of DeclaratorDecl are FieldDecl, FunctionDecl, and VarDecl.
EnumConstantDecl still inherits from ValueDecl since it has no need for DeclaratorInfo.

Decl/Sema interfaces accept a DeclaratorInfo as parameter but no DeclaratorInfo is created yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79392 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
1d954f6a0057cb55a3a5d483904a3c57d03c996f 15-Aug-2009 Eli Friedman <eli.friedman@gmail.com> Implement __is_empty. Patch by Sean Hunt.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79143 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
fd810b1386ed29b250e7d522ea826a65c815e49d 14-Aug-2009 John McCall <rjmccall@apple.com> Support friend declarations in templates and test that argdep lookup
still works.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78979 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
fee13819693c8492f0c364bc704645e844ef737a 08-Aug-2009 Edward O'Callaghan <eocallaghan@auroraux.org> Patch should implement packed enums - PR4098. Credit to Anders Johnsen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78471 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
43d9d9243329b1b75d1a6efdad9f16d6fb386b8e 08-Aug-2009 Douglas Gregor <dgregor@apple.com> Introduce reference counting for statements and expressions, using it
to allow sharing of nodes. Simplifies some aspects of template
instantiation, and fixes both PR3444 and <rdar://problem/6757457>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78450 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
50d62d1b4a98adbc83de8f8cd1379ea1c25656f7 05-Aug-2009 Douglas Gregor <dgregor@apple.com> Introduce the canonical type smart pointers, and use them in a few places to
tighten up the static type system.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78164 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
ac5fc7c6bcb494b60fee7ce615ac931c5db6135e 04-Aug-2009 Mike Stump <mrs@apple.com> Canonicalize else.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78102 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
828e226ab7ed08b3eb766549e9d3306432137460 29-Jul-2009 Douglas Gregor <dgregor@apple.com> Use the new statement/expression profiling code to unique dependent
template arguments, as in template specialization types. This permits
matching out-of-line definitions of members for class templates that
involve non-type template parameters.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77462 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
65b90055dd30cfb83d8344ff62ed428257431be4 27-Jul-2009 Douglas Gregor <dgregor@apple.com> When instantiating a variable without an initializer, call
ActOnUninitializedDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77211 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
7caa6825f42a0f7e97d6fc06233133c42b218e46 24-Jul-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for static data members that are defined out-of-line.

Note that this also fixes a bug that affects non-template code, where we
were not treating out-of-line static data members are "file-scope" variables,
and therefore not checking their initializers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77002 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
741dd9a7e1d63e4e385b657e4ce11c5d96d44f72 21-Jul-2009 Douglas Gregor <dgregor@apple.com> Add the location of the tag keyword into TagDecl. From Enea
Zaffanella, with tweaks from Abramo Bagnara.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76576 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
97fbaa2a38804268a024f1a104b43fcf8b4411b0 18-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove ASTContext::getCanonicalDecl() and use Decl::getCanonicalDecl in its place.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76274 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
bcbb8bd3326a86aa70b7df386ae3c86c9ad255c5 17-Jul-2009 Daniel Dunbar <daniel@zuster.org> Fix unused variable warnings (with -Asserts)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76112 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
ea218b8e8f9ba82d1c76bcb7e86d121a5f65ebed 14-Jul-2009 Steve Naroff <snaroff@apple.com> Add a "TypeSpecStartLoc" to FieldDecl. Patch contributed by Enea Zaffanella.

Note: One day, it might be useful to consider adding this info to DeclGroup (as the comments in FunctionDecl/VarDecl suggest). For now, I think this works fine. I considered moving this to ValueDecl (a common ancestor of FunctionDecl/VarDecl/FieldDecl), however this would add overhead to EnumConstantDecl (which would burn memory and isn't necessary).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75635 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
cca9e9674a5e50a283185d8e9d8a5c3414eb008e 02-Jul-2009 Douglas Gregor <dgregor@apple.com> Keep track of more information within the template instantiation stack, e.g.,
by distinguishing between substitution that occurs for template
argument deduction vs. explicitly-specifiad template arguments. This
is used both to improve diagnostics and to make sure we only provide
SFINAE in those cases where SFINAE should apply.

In addition, deal with the sticky issue where SFINAE only considers
substitution of template arguments into the *type* of a function
template; we need to issue hard errors beyond this point, as
test/SemaTemplate/operator-template.cpp illustrates.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74651 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
b33fe2ff12676bff9db595fdf77e29014d7ba397 30-Jun-2009 Douglas Gregor <dgregor@apple.com> When recursively instantiating function templates, keep track of the
instantiation stack so that we provide a full instantiation
backtrace. Previously, we performed all of the instantiations implied
by the recursion, but each looked like a "top-level" instantiation.

The included test case tests the previous fix for the instantiation of
DeclRefExprs. Note that the "instantiated from" diagnostics still
don't tell us which template arguments we're instantiating with.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74540 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
751f9a416a94fe723e6c34fc15fff2ccdf1c4be9 30-Jun-2009 Douglas Gregor <dgregor@apple.com> Refactor ActOnDeclarationNameExpr into a "parsing action" part and a
"semantic analysis" part. Use the "semantic analysis" part when
performing template instantiation on a DeclRefExpr, rather than an ad
hoc list of rules to construct DeclRefExprs from the instantiation.

A test case for this change will come in with a large commit, which
illustrates what I was actually trying to work on.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74528 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
17945a0f64fe03ff6ec0c2146005a87636e3ac12 30-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> De-ASTContext-ify DeclContext.

Remove ASTContext parameter from DeclContext's methods. This change cascaded down to other Decl's methods and changes to call sites started "escalating".
Timings using pre-tokenized "cocoa.h" showed only a ~1% increase in time run between and after this commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74506 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
6fb0aee4f9dc261bbec72e1283ad8dc0557a6d96 30-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove the ASTContext parameter from the getBody() methods of Decl and subclasses.

Timings showed no significant difference before and after the commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74504 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
127102b5196ffe04bdb70fd553fe62c265ab10a9 29-Jun-2009 Douglas Gregor <dgregor@apple.com> Keep track of function template specializations, to eliminate
redundant, implicit instantiations of function templates and provide a
place where we can hang function template specializations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74454 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
1637be727f2a0434c1ed7aa385ea1c18328b0ccd 26-Jun-2009 Douglas Gregor <dgregor@apple.com> Implicit instantiation for function template specializations.

For a FunctionDecl that has been instantiated due to template argument
deduction, we now store the primary template from which it was
instantiated and the deduced template arguments. From this
information, we can instantiate the body of the function template.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74232 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
e53060fa78ad7e98352049f72787bdb7543e2a48 26-Jun-2009 Douglas Gregor <dgregor@apple.com> Improved semantic analysis and AST respresentation for function
templates.

For example, this now type-checks (but does not instantiate the body
of deref<int>):

template<typename T> T& deref(T* t) { return *t; }

void test(int *ip) {
int &ir = deref(ip);
}

Specific changes/additions:
* Template argument deduction from a call to a function template.
* Instantiation of a function template specializations (just the
declarations) from the template arguments deduced from a call.
* FunctionTemplateDecls are stored directly in declaration contexts
and found via name lookup (all forms), rather than finding the
FunctionDecl and then realizing it is a template. This is
responsible for most of the churn, since some of the core
declaration matching and lookup code assumes that all functions are
FunctionDecls.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74213 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
d7f37bf8b9a211455c5037df7b7e88e5a9510119 23-Jun-2009 Douglas Gregor <dgregor@apple.com> Implement implicit instantiation of the member functions of a class template
specialization. At present, all implicit instantiations occur at the
end of the translation unit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73915 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
ac7610dad6653bad02dd42de198ca358b6fb1f1d 22-Jun-2009 Douglas Gregor <dgregor@apple.com> Rework the way we track which declarations are "used" during
compilation, and (hopefully) introduce RAII objects for changing the
"potentially evaluated" state at all of the necessary places within
Sema and Parser. Other changes:

- Set the unevaluated/potentially-evaluated context appropriately
during template instantiation.
- We now recognize three different states while parsing or
instantiating expressions: unevaluated, potentially evaluated, and
potentially potentially evaluated (for C++'s typeid).
- When we're in a potentially potentially-evaluated context, queue
up MarkDeclarationReferenced calls in a stack. For C++ typeid
expressions that are potentially evaluated, we will play back
these MarkDeclarationReferenced calls when we exit the
corresponding potentially potentially-evaluated context.
- Non-type template arguments are now parsed as constant
expressions, so they are not potentially-evaluated.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73899 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
0ca20ac8cea99c43d89510f29cf3dc876f9c9111 29-May-2009 Douglas Gregor <dgregor@apple.com> Reduce the amount of stack space we use in SmallVectors during
template instantiation. This helps reduce our stack footprint when
performing deep template instantiations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72582 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
8e92bf33baa91a8d97cbd4859648af149d5b5e74 29-May-2009 Douglas Gregor <dgregor@apple.com> Now that we have declared/defined tag types within DeclGroups,
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72568 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
bc221637f5ed3538b8495dd13b831c11e821c712 28-May-2009 Douglas Gregor <dgregor@apple.com> Introduced DeclContext::isDependentContext, which determines whether a
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72526 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
ed961e7fffc268eeace169869f5a059bcbd5fcbd 27-May-2009 Douglas Gregor <dgregor@apple.com> Simplify, and improve the performance of, template instantiation for
declaration references. The key realization is that dependent Decls,
which actually require instantiation, can only refer to the current
instantiation or members thereof. And, since the current context
during instantiation contains all of those members of the current
instantiation, we can simply find the real instantiate that matches up
with the "current instantiation" template.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72486 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
8dbc3c64965f99e48830885835b7d2fc26ec3cf5 27-May-2009 Douglas Gregor <dgregor@apple.com> Enumeration declarations that were instantiated from an enumeration
within a template now have a link back to the enumeration from which
they were instantiated. This means that we can now find the
instantiation of an anonymous enumeration.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72482 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
2bba76b0ec4c2f2134eebb1a2bbfe102f36c2f6e 27-May-2009 Douglas Gregor <dgregor@apple.com> Improve name lookup for and template instantiation of declaration
references. There are several smallish fixes here:

- Make sure we look through template parameter scope when
determining whether we're parsing a nested class (or nested class
*template*). This makes sure that we delay parsing the bodies of
inline member functions until after we're out of the outermost
class (template) scope.
- Since the bodies of member functions are always parsed
"out-of-line", even when they were declared in-line, teach
unqualified name lookup to look into the (semantic) parents.
- Use the new InstantiateDeclRef to handle the instantiation of a
reference to a declaration (in DeclRefExpr), which drastically
simplifies template instantiation for DeclRefExprs.
- When we're instantiating a ParmVarDecl, it must be in the current
instantiation scope, so only look there.

Also, remove the #if 0's and FIXME's from the dynarray example, which
now compiles and executes thanks to Anders and Eli.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72481 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
815215daf8f642b53a28212313fca7b9f77e5b9d 27-May-2009 Douglas Gregor <dgregor@apple.com> Initial stab at a generalized operation for determining the
instantiation of a declaration from the template version (or version
that lives in a template) and a given set of template arguments. This
needs much, much more testing, but it suffices for simple examples
like

typedef T* iterator;
iterator begin();




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72461 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
aba43bb13b3aa3e81990989375fba3a902bfe1c2 26-May-2009 Douglas Gregor <dgregor@apple.com> Make sure that CodeGen sees template instantiations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72433 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
beaaccd8e2a8748f77b66e2b330fb9136937e14c 21-May-2009 Jay Foad <jay.foad@gmail.com> Use v.data() instead of &v[0] when SmallVector v might be empty.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72210 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
d308e6201afd3a8a198c52ba034d35ed19d4bafe 18-May-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for C++ try/catch statements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72035 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
f3e7ce4bd9837cdab6a096235922865f95467d3d 18-May-2009 Douglas Gregor <dgregor@apple.com> When instantiating the definition of a member function of a class
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72015 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
390b4cc8b45a05612349269ef08faab3e4688f06 16-May-2009 Mike Stump <mrs@apple.com> Reflow some comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71936 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
c6e35aae23bc3cea7daf5ee075fa695c01c0f66f 16-May-2009 Mike Stump <mrs@apple.com> Implement a FIXME, we now pass in the locations of the braces for enums.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71930 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
49f25ecf7ff358039ce4c9254b867f32110e660e 15-May-2009 Douglas Gregor <dgregor@apple.com> Make sure that we use the canonical type for the names of instantiated
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71895 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
e2c31ff0bc622e6fd7d47d7e08b53840f3be6c89 15-May-2009 Douglas Gregor <dgregor@apple.com> Call ActOnStartOfFunctionDecl/ActOnFinishFunctionBody when
instantiating the definition of a function from a template.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71869 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
b9f1b8d877541e76390cd3807c2dcff2f950360a 15-May-2009 Douglas Gregor <dgregor@apple.com> Implement template instantiation for DeclStmt

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71818 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
54dabfca850ca9e60e9ffb60003529f868d4d127 15-May-2009 Douglas Gregor <dgregor@apple.com> Introduce basic support for instantiating the definitions of member
functions of class templates. Only compound statements and expression
statements are currently implemented.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71814 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
77b7f1d4fb782c9152f91b76f9f8b1d1af21bd35 15-May-2009 Anders Carlsson <andersca@mac.com> Check that the function being overridden is virtual.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71802 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
48dd19b19ddb9e105f8cf0bf6f0732ca4e6a385b 14-May-2009 Douglas Gregor <dgregor@apple.com> Introduce a stack of instantiation scopes that are used to store the mapping from variable declarations that occur within templates to their instantiated counterparts

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71799 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
1eee0e753fb390b04848846e837714ec774b7bfd 14-May-2009 Douglas Gregor <dgregor@apple.com> Link FunctionDecls instantiated from the member functions of a class
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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71792 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
a58861f6490780baec50689e06ca65f7438b85dc 13-May-2009 Douglas Gregor <dgregor@apple.com> Explicit instantiations of templates now instantiate the definitions
of class members (recursively). Only member classes are actually
instantiated; the instantiation logic for member functions and
variables are just stubs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71713 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
7e06390f8a60440d6fc5f0e633acdc2edd8ee924 12-May-2009 Douglas Gregor <dgregor@apple.com> Encapsulate template arguments lists in a new class,
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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71517 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
7da97d0f31e1ec16998d3de2cfd2e88fe3736673 11-May-2009 Douglas Gregor <dgregor@apple.com> Implement the semantics of the injected-class-name within a class
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71408 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
e9146f2e9f1c4e281544e8c080934c72d41012ca 01-May-2009 Anders Carlsson <andersca@mac.com> Replace more release+static_cast with takeAs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70567 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
eaaebc7cf10dc1a2016183a262ad3256bc468759 25-Apr-2009 Chris Lattner <sabre@nondot.org> This is a pretty big cleanup for how invalid decl/type are handle.
This gets rid of a bunch of random InvalidDecl bools in sema, changing
us to use the following approach:

1. When analyzing a declspec or declarator, if an error is found, we
set a bit in Declarator saying that it is invalid.
2. Once the Decl is created by sema, we immediately set the isInvalid
bit on it from what is in the declarator. From this point on, sema
consistently looks at and sets the bit on the decl.

This gives a very clear separation of concerns and simplifies a bunch
of code. In addition to this, this patch makes these changes:

1. it renames DeclSpec::getInvalidType() -> isInvalidType().
2. various "merge" functions no longer return bools: they just set the
invalid bit on the dest decl if invalid.
3. The ActOnTypedefDeclarator/ActOnFunctionDeclarator/ActOnVariableDeclarator
methods now set invalid on the decl returned instead of returning an
invalid bit byref.
4. In SemaType, refering to a typedef that was invalid now propagates the
bit into the resultant type. Stuff declared with the invalid typedef
will now be marked invalid.
5. Various methods like CheckVariableDeclaration now return void and set the
invalid bit on the decl they check.


There are a few minor changes to tests with this, but the only major bad
result is test/SemaCXX/constructor-recovery.cpp. I'll take a look at this
next.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70020 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
6ab3524f72a6e64aa04973fa9433b5559abb3525 09-Apr-2009 Douglas Gregor <dgregor@apple.com> Propagate the ASTContext to various AST traversal and lookup functions.
No functionality change (really).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68726 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
b28317a8e5e0e2953d1e5406d753d6c3c7f1e7d2 28-Mar-2009 Chris Lattner <sabre@nondot.org> Introduce a new OpaquePtr<N> struct type, which is a simple POD wrapper for a
pointer. Its purpose in life is to be a glorified void*, but which does not
implicitly convert to void* or other OpaquePtr's with a different UID.

Introduce Action::DeclPtrTy which is a typedef for OpaquePtr<0>. Change the
entire parser/sema interface to use DeclPtrTy instead of DeclTy*. This
makes the C++ compiler enforce that these aren't convertible to other opaque
types.

We should also convert ExprTy, StmtTy, TypeTy, AttrTy, BaseTy, etc,
but I don't plan to do that in the short term.

The one outstanding known problem with this patch is that we lose the
bitmangling optimization where ActionResult<DeclPtrTy> doesn't know how to
bitmangle the success bit into the low bit of DeclPtrTy. I will rectify
this with a subsequent patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67952 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
befc20e1dc869edb0e7b560e69f32d5c71f867ab 26-Mar-2009 Douglas Gregor <dgregor@apple.com> The injected-class-name of class templates and class template
specializations can be treated as a template. Finally, we can parse
and process the first implementation of Fibonacci I wrote!

Note that this code does not handle all of the cases where
injected-class-names can be treated as templates. In particular,
there's an ambiguity case that we should be able to handle (but
can't), e.g.,

template <class T> struct Base { };
template <class T> struct Derived : Base<int>, Base<char> {
typename Derived::Base b; // error: ambiguous
typename Derived::Base<double> d; // OK
};




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67720 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
3d7a12a50558c31d4351e923c15ab57688f4fdf2 26-Mar-2009 Douglas Gregor <dgregor@apple.com> Implement template instantiation for static data members of class
templates, including in-class initializers. For example:

template<typename T, T Divisor>
class X {
public:
static const T value = 10 / Divisor;
};

instantiated with, e.g.,

X<int, 5>::value

to get the value '2'.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67715 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
06c0fecd197fef21e265a41bca8dc5022de1f864 25-Mar-2009 Douglas Gregor <dgregor@apple.com> Pass access specifiers through to member classes and member enums.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67710 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
d475b8d9e6f5ff0e6ab8d15667ce8a64c7cb9a4d 25-Mar-2009 Douglas Gregor <dgregor@apple.com> Instantiation for member classes of class templates. Note that only
the declarations of member classes are instantiated when the owning
class template is instantiated. The definitions of such member classes
are instantiated when a complete type is required.

This change also introduces the injected-class-name into a class
template specialization.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67707 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
4f722be4587a7a0dece399fb5405dda158971ae1 25-Mar-2009 Douglas Gregor <dgregor@apple.com> Stub out some declaration kinds that cannot ever be instantiated

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67686 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
6477b69cc93e0a0ff15036d60d604f3544da0f29 25-Mar-2009 Douglas Gregor <dgregor@apple.com> Minor refactoring to eliminate an extra switch during template instantiation

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67684 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
bb969ed4193e2eadabfaa0dfd0b94312b6146349 25-Mar-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for conversion functions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67664 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
615c5d4674355ba830b9978f462ca7a8c5d15f85 24-Mar-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for constructors

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67623 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
8211effbd3abc5948a5d6924c87e72323016a376 24-Mar-2009 Anders Carlsson <andersca@mac.com> More work on diagnosing abstract classes. We can now handle cases like

class C {
void g(C c);

virtual void f() = 0;
};

In this case, C is not known to be abstract when doing semantic analysis on g. This is done by recursively traversing the abstract class and checking the types of member functions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67594 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
5545e166a956a20d7a6b58408e251a1119025485 24-Mar-2009 Douglas Gregor <dgregor@apple.com> Cleanup template instantiation for methods, destructors

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67585 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
03b2b07aaef3a585aec13048a33356c7f635de72 24-Mar-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for destructors. This is somewhat repetitive;
eliminating the duplication is next on the list.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67579 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
2dc0e64e57b2a1786fa53a7dbd1d5c8e255eadb0 24-Mar-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for the declarations of member functions within
a class template. At present, we can only instantiation normal
methods, but not constructors, destructors, or conversion operators.

As ever, this contains a bit of refactoring in Sema's type-checking. In
particular:

- Split ActOnFunctionDeclarator into ActOnFunctionDeclarator
(handling the declarator itself) and CheckFunctionDeclaration
(checking for the the function declaration), the latter of which
is also used by template instantiation.
- We were performing the adjustment of function parameter types in
three places; collect those into a single new routine.
- When the type of a parameter is adjusted, allocate an
OriginalParmVarDecl to keep track of the type as it was written.
- Eliminate a redundant check for out-of-line declarations of member
functions; hide more C++-specific checks on function declarations
behind if(getLangOptions().CPlusPlus).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67575 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
8dbc2694424b4e842b1d5ea39744a137b58600c3 17-Mar-2009 Douglas Gregor <dgregor@apple.com> Refactor instantiation of declarations within a template into a much
cleaner visitor framework.

Added a visitor for declarations, which is quite similar to the
visitor for statatements.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67104 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp