aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaType.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-03-19 00:39:20 +0000
committerDouglas Gregor <dgregor@apple.com>2009-03-19 00:39:20 +0000
commite6258936178b4c52b43b3b9dbec13552961cd645 (patch)
tree4ca4bb163b6ec04f57e3e982bbe3396754e19d91 /lib/Sema/SemaType.cpp
parentc20482b10ee4ffcea31f67392743ccdf6df1f7f4 (diff)
Extend the use of QualifiedNameType to the creation of class template
specialization names. This way, we keep track of sugared types like std::vector<Real> I believe we are now using QualifiedNameTypes everywhere we can. Next step: QualifiedDeclRefExprs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67268 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r--lib/Sema/SemaType.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp
index a8be924fc8..24b32e8147 100644
--- a/lib/Sema/SemaType.cpp
+++ b/lib/Sema/SemaType.cpp
@@ -1077,3 +1077,16 @@ bool Sema::RequireCompleteType(SourceLocation Loc, QualType T, unsigned diag,
return true;
}
+
+/// \brief Retrieve a version of the type 'T' that is qualified by the
+/// nested-name-specifier contained in SS.
+QualType Sema::getQualifiedNameType(const CXXScopeSpec &SS, QualType T) {
+ if (!SS.isSet() || SS.isInvalid() || T.isNull())
+ return T;
+
+ llvm::SmallVector<NestedNameSpecifier, 4> Specs;
+ for (CXXScopeSpec::iterator Spec = SS.begin(), SpecEnd = SS.end();
+ Spec != SpecEnd; ++Spec)
+ Specs.push_back(NestedNameSpecifier::getFromOpaquePtr(*Spec));
+ return Context.getQualifiedNameType(&Specs[0], Specs.size(), T);
+}