summaryrefslogtreecommitdiffstats
path: root/lib/AST/NestedNameSpecifier.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/AST/NestedNameSpecifier.cpp')
-rw-r--r--lib/AST/NestedNameSpecifier.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/AST/NestedNameSpecifier.cpp b/lib/AST/NestedNameSpecifier.cpp
index 548f2f8e3b..42f6a133d7 100644
--- a/lib/AST/NestedNameSpecifier.cpp
+++ b/lib/AST/NestedNameSpecifier.cpp
@@ -462,9 +462,9 @@ SourceRange NestedNameSpecifierLoc::getLocalSourceRange() const {
}
TypeLoc NestedNameSpecifierLoc::getTypeLoc() const {
- assert((Qualifier->getKind() == NestedNameSpecifier::TypeSpec ||
- Qualifier->getKind() == NestedNameSpecifier::TypeSpecWithTemplate) &&
- "Nested-name-specifier location is not a type");
+ if (Qualifier->getKind() != NestedNameSpecifier::TypeSpec &&
+ Qualifier->getKind() != NestedNameSpecifier::TypeSpecWithTemplate)
+ return TypeLoc();
// The "void*" that points at the TypeLoc data.
unsigned Offset = getDataLength(Qualifier->getPrefix());