Skip to content

Commit 9ac6a55

Browse files
[clang][AST] Assert that DependentNameType's Name and NNS are not null (llvm#122418)
Also clarify the comment above DependentNameType::getIdentifier()
1 parent da4ac13 commit 9ac6a55

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
@@ -7040,17 +7040,17 @@ class DependentNameType : public TypeWithKeyword, public llvm::FoldingSetNode {
70407040
: TypeWithKeyword(Keyword, DependentName, CanonType,
70417041
TypeDependence::DependentInstantiation |
70427042
toTypeDependence(NNS->getDependence())),
7043-
NNS(NNS), Name(Name) {}
7043+
NNS(NNS), Name(Name) {
7044+
assert(NNS);
7045+
assert(Name);
7046+
}
70447047

70457048
public:
70467049
/// Retrieve the qualification on this type.
70477050
NestedNameSpecifier *getQualifier() const { return NNS; }
70487051

7049-
/// Retrieve the type named by the typename specifier as an identifier.
7050-
///
7051-
/// This routine will return a non-NULL identifier pointer when the
7052-
/// form of the original typename was terminated by an identifier,
7053-
/// e.g., "typename T::type".
7052+
/// Retrieve the identifier that terminates this type name.
7053+
/// For example, "type" in "typename T::type".
70547054
const IdentifierInfo *getIdentifier() const {
70557055
return Name;
70567056
}

0 commit comments

Comments
 (0)