Skip to content

Commit 491b3ea

Browse files
[clang][AST] Assert that DependentNameType's Name and NNS are not null
Also clarify the comment above DependentNameType::getIdentifier()
1 parent a6aa936 commit 491b3ea

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

clang/include/clang/AST/Type.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7035,17 +7035,17 @@ class DependentNameType : public TypeWithKeyword, public llvm::FoldingSetNode {
70357035
: TypeWithKeyword(Keyword, DependentName, CanonType,
70367036
TypeDependence::DependentInstantiation |
70377037
toTypeDependence(NNS->getDependence())),
7038-
NNS(NNS), Name(Name) {}
7038+
NNS(NNS), Name(Name) {
7039+
assert(NNS);
7040+
assert(Name);
7041+
}
70397042

70407043
public:
70417044
/// Retrieve the qualification on this type.
70427045
NestedNameSpecifier *getQualifier() const { return NNS; }
70437046

7044-
/// Retrieve the type named by the typename specifier as an identifier.
7045-
///
7046-
/// This routine will return a non-NULL identifier pointer when the
7047-
/// form of the original typename was terminated by an identifier,
7048-
/// e.g., "typename T::type".
7047+
/// Retrieve the identifier that terminates this type name.
7048+
/// For example, "type" in "typename T::type".
70497049
const IdentifierInfo *getIdentifier() const {
70507050
return Name;
70517051
}

0 commit comments

Comments
 (0)