summaryrefslogtreecommitdiffstats
path: root/lib/AST/NestedNameSpecifier.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-02-25 16:33:46 +0000
committerDouglas Gregor <dgregor@apple.com>2011-02-25 16:33:46 +0000
commitdb9924191092b4d426cc066637d81698211846aa (patch)
tree8f7ee9a903d317063c55749b1ce8e544cbcc5a7a /lib/AST/NestedNameSpecifier.cpp
parenta8eef310e3f7dce7038375e771561736386190fd (diff)
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
Diffstat (limited to 'lib/AST/NestedNameSpecifier.cpp')
-rw-r--r--lib/AST/NestedNameSpecifier.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/AST/NestedNameSpecifier.cpp b/lib/AST/NestedNameSpecifier.cpp
index 0689ae1c88..6f1ec058d7 100644
--- a/lib/AST/NestedNameSpecifier.cpp
+++ b/lib/AST/NestedNameSpecifier.cpp
@@ -321,8 +321,11 @@ namespace {
}
SourceRange NestedNameSpecifierLoc::getSourceRange() const {
+ if (!Qualifier)
+ return SourceRange();
+
NestedNameSpecifierLoc First = *this;
- while (NestedNameSpecifierLoc Prefix= First.getPrefix())
+ while (NestedNameSpecifierLoc Prefix = First.getPrefix())
First = Prefix;
return SourceRange(First.getLocalSourceRange().getBegin(),
@@ -330,6 +333,9 @@ SourceRange NestedNameSpecifierLoc::getSourceRange() const {
}
SourceRange NestedNameSpecifierLoc::getLocalSourceRange() const {
+ if (!Qualifier)
+ return SourceRange();
+
unsigned Offset = getDataLength(Qualifier->getPrefix());
switch (Qualifier->getKind()) {
case NestedNameSpecifier::Global: