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
diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h
index 3755744..df1e7c3 100644
--- a/lib/Sema/Sema.h
+++ b/lib/Sema/Sema.h
@@ -1455,6 +1455,7 @@
   bool RequireCompleteDeclContext(const CXXScopeSpec &SS);
   
   DeclContext *computeDeclContext(const CXXScopeSpec &SS);
+  bool isDependentScopeSpecifier(const CXXScopeSpec &SS);
 
   /// ActOnCXXGlobalScopeSpecifier - Return the object that represents the
   /// global scope ('::').
@@ -1880,6 +1881,12 @@
                            ClassTemplateSpecializationDecl *ClassTemplateSpec,
                            bool ExplicitInstantiation);
 
+  CXXScopeSpec InstantiateScopeSpecifier(const NestedNameSpecifier *Components,
+                                         unsigned NumComponents,
+                                         SourceRange Range,
+                                         const TemplateArgument *TemplateArgs,
+                                         unsigned NumTemplateArgs);
+
   // Simple function for cloning expressions.
   template<typename T> 
   OwningExprResult Clone(T *E) {