diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-05-11 08:41:30 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-05-11 08:41:30 +0000 |
commit | bb6e73fcf60fa5a4cc36c14744dc366b658443b5 (patch) | |
tree | b7d1eb4dff59d4bfc4cdc805ef2b6c2008f6d01c /lib/AST/Type.cpp | |
parent | 444eaa83cc2dd7904e4deed82574696b9337de02 (diff) |
A DeclRefExpr that refers to a member function or a static data member
of the current instantiation is value-dependent. The C++ standard
fails to enumerate this case and, therefore, we missed it. Chandler
did all of the hard work of reducing the last remaining
Boost.PtrContainer failure (which had to do with static initialization
in the Serialization library) down to this simple little test.
While I'm at it, clean up the dependence rules for template arguments
that are declarations, and implement the dependence rules for template
argument packs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103464 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Type.cpp')
-rw-r--r-- | lib/AST/Type.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index 05e7fdc49e..73f0e91dab 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -975,6 +975,10 @@ static bool isDependent(const TemplateArgument &Arg) { return Arg.getAsTemplate().isDependent(); case TemplateArgument::Declaration: + if (DeclContext *DC = dyn_cast<DeclContext>(Arg.getAsDecl())) + return DC->isDependentContext(); + return Arg.getAsDecl()->getDeclContext()->isDependentContext(); + case TemplateArgument::Integral: // Never dependent return false; @@ -984,7 +988,13 @@ static bool isDependent(const TemplateArgument &Arg) { Arg.getAsExpr()->isValueDependent()); case TemplateArgument::Pack: - assert(0 && "FIXME: Implement!"); + for (TemplateArgument::pack_iterator P = Arg.pack_begin(), + PEnd = Arg.pack_end(); + P != PEnd; ++P) { + if (isDependent(*P)) + return true; + } + return false; } |