2626namespace clang {
2727namespace mrdocs {
2828
29- enum QualifierKind : int
29+ enum QualifierKind
3030{
3131 None,
3232 Const,
@@ -39,6 +39,7 @@ enum class TypeKind
3939{
4040 Named = 1 , // for bitstream
4141 Decltype,
42+ Auto,
4243 LValueReference,
4344 RValueReference,
4445 Pointer,
@@ -49,6 +50,14 @@ enum class TypeKind
4950
5051MRDOCS_DECL dom::String toString (TypeKind kind) noexcept ;
5152
53+ enum class AutoKind
54+ {
55+ Auto,
56+ DecltypeAuto
57+ };
58+
59+ MRDOCS_DECL dom::String toString (AutoKind kind) noexcept ;
60+
5261struct TypeInfo
5362{
5463 /* * The kind of TypeInfo this is
@@ -63,6 +72,7 @@ struct TypeInfo
6372
6473 constexpr bool isNamed () const noexcept { return Kind == TypeKind::Named; }
6574 constexpr bool isDecltype () const noexcept { return Kind == TypeKind::Decltype; }
75+ constexpr bool isAuto () const noexcept { return Kind == TypeKind::Auto; }
6676 constexpr bool isLValueReference () const noexcept { return Kind == TypeKind::LValueReference; }
6777 constexpr bool isRValueReference () const noexcept { return Kind == TypeKind::RValueReference; }
6878 constexpr bool isPointer () const noexcept { return Kind == TypeKind::Pointer; }
@@ -100,6 +110,7 @@ struct IsType : TypeInfo
100110
101111 static constexpr bool isNamed () noexcept { return K == TypeKind::Named; }
102112 static constexpr bool isDecltype () noexcept { return K == TypeKind::Decltype; }
113+ static constexpr bool isAuto () noexcept { return K == TypeKind::Auto; }
103114 static constexpr bool isLValueReference () noexcept { return K == TypeKind::LValueReference; }
104115 static constexpr bool isRValueReference () noexcept { return K == TypeKind::RValueReference; }
105116 static constexpr bool isPointer () noexcept { return K == TypeKind::Pointer; }
@@ -129,6 +140,14 @@ struct DecltypeTypeInfo
129140 ExprInfo Operand;
130141};
131142
143+ struct AutoTypeInfo
144+ : IsType<TypeKind::Auto>
145+ {
146+ QualifierKind CVQualifiers = QualifierKind::None;
147+ AutoKind Keyword = AutoKind::Auto;
148+ std::unique_ptr<NameInfo> Constraint;
149+ };
150+
132151struct LValueReferenceTypeInfo
133152 : IsType<TypeKind::LValueReference>
134153{
@@ -226,6 +245,10 @@ visit(
226245 return f (static_cast <add_cv_from_t <
227246 TypeTy, DecltypeTypeInfo>&>(II),
228247 std::forward<Args>(args)...);
248+ case TypeKind::Auto:
249+ return f (static_cast <add_cv_from_t <
250+ TypeTy, AutoTypeInfo>&>(II),
251+ std::forward<Args>(args)...);
229252 case TypeKind::LValueReference:
230253 return f (static_cast <add_cv_from_t <
231254 TypeTy, LValueReferenceTypeInfo>&>(II),
0 commit comments