]> granicus.if.org Git - clang/commit
Introduce a new expression type, UnresolvedDeclRefExpr, that describes
authorDouglas Gregor <dgregor@apple.com>
Thu, 19 Mar 2009 17:26:29 +0000 (17:26 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 19 Mar 2009 17:26:29 +0000 (17:26 +0000)
commit5953d8b37f92f0cf548941f617c9b0a7703df33b
treee9b4379486d998455e7f649c99f5d5f79d51ee80
parent5e1e1f95c98b1add70c238093bbd5dc8d4f9c4e9
Introduce a new expression type, UnresolvedDeclRefExpr, that describes
dependent qualified-ids such as

  Fibonacci<N - 1>::value

where N is a template parameter. These references are "unresolved"
because the name is dependent and, therefore, cannot be resolved to a
declaration node (as we would do for a DeclRefExpr or
QualifiedDeclRefExpr). UnresolvedDeclRefExprs instantiate to
DeclRefExprs, QualifiedDeclRefExprs, etc.

Also, be a bit more careful about keeping only a single set of
specializations for a class template, and instantiating from the
definition of that template rather than a previous declaration. In
general, we need a better solution for this for all TagDecls, because
it's too easy to accidentally look at a declaration that isn't the
definition.

We can now process a simple Fibonacci computation described as a
template metaprogram.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67308 91177308-0d34-0410-b5e6-96231b3b80d8
14 files changed:
include/clang/AST/DeclTemplate.h
include/clang/AST/ExprCXX.h
include/clang/AST/StmtNodes.def
include/clang/Parse/DeclSpec.h
lib/AST/DeclTemplate.cpp
lib/AST/ExprCXX.cpp
lib/AST/StmtPrinter.cpp
lib/Sema/Sema.h
lib/Sema/SemaCXXScopeSpec.cpp
lib/Sema/SemaDecl.cpp
lib/Sema/SemaExpr.cpp
lib/Sema/SemaTemplate.cpp
lib/Sema/SemaTemplateInstantiate.cpp
test/SemaTemplate/fibonacci.cpp [new file with mode: 0644]