diff --git a/src/lib/AST/ASTVisitor.cpp b/src/lib/AST/ASTVisitor.cpp index e38324a111..79790f422d 100644 --- a/src/lib/AST/ASTVisitor.cpp +++ b/src/lib/AST/ASTVisitor.cpp @@ -2242,6 +2242,10 @@ ASTVisitor::getSFINAETemplateInfo(QualType T, bool const AllowDependentNames) co T = QualType(DNT->getQualifier()->getAsType(), 0); MRDOCS_SYMBOL_TRACE(T, context_); } + if (!T.getTypePtrOrNull()) + { + return std::nullopt; + } // If the type is a template specialization type, extract the template name // and the template arguments diff --git a/test-files/golden-tests/metadata/sfinae.adoc b/test-files/golden-tests/metadata/sfinae.adoc index a1bd59a962..830707c3d8 100644 --- a/test-files/golden-tests/metadata/sfinae.adoc +++ b/test-files/golden-tests/metadata/sfinae.adoc @@ -25,6 +25,12 @@ | <> | Specialization for floating point types +| <> +| SFINAE with std::void_t + +| <> +| SFINAE with std::void_t + |=== === Functions @@ -136,6 +142,94 @@ class <><T, void>; +[#S-02] +== S + + +SFINAE with std::void_t + +=== Synopsis + + +Declared in `<sfinae.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template< + class T, + class = void> +struct S; +---- + +=== Member Functions + +[cols=1] +|=== +| Name + +| <> +|=== + + + +[#S-02-store] +== <>::store + + +=== Synopsis + + +Declared in `<sfinae.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +store(void const*); +---- + +[#S-08] +== S<T, std::void_t<T::a::b>> + + +SFINAE with std::void_t + +=== Synopsis + + +Declared in `<sfinae.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template<class T> +struct <><T, std::void_t<T::a::b>>; +---- + +=== Member Functions + +[cols=1] +|=== +| Name + +| <> +|=== + + + +[#S-08-store] +== <><T, std::void_t<T::a::b>>::store + + +=== Synopsis + + +Declared in `<sfinae.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +store(void const*); +---- + [#f1] == f1 diff --git a/test-files/golden-tests/metadata/sfinae.cpp b/test-files/golden-tests/metadata/sfinae.cpp index a7c4ef1795..3e4d9443d1 100644 --- a/test-files/golden-tests/metadata/sfinae.cpp +++ b/test-files/golden-tests/metadata/sfinae.cpp @@ -71,3 +71,17 @@ class A {}; /// Specialization for floating point types template class A>> {}; + +/// SFINAE with std::void_t +template +struct S +{ + void store(const void*) {} +}; + +/// SFINAE with std::void_t +template +struct S> +{ + void store(const void*) {} +}; diff --git a/test-files/golden-tests/metadata/sfinae.html b/test-files/golden-tests/metadata/sfinae.html index 0291e52299..ec92a403c5 100644 --- a/test-files/golden-tests/metadata/sfinae.html +++ b/test-files/golden-tests/metadata/sfinae.html @@ -35,6 +35,12 @@

Types

A<T, void> Specialization for floating point types + +S SFINAE with std::void_t + + +S<T, std::void_t<T::a::b>> SFINAE with std::void_t + @@ -161,6 +167,110 @@

Synopsis

+ +
+
+

S

+
+SFINAE with std::void_t + + +
+
+
+

Synopsis

+
+Declared in <sfinae.cpp>
+
+
+template<
+    class T,
+    class = void>
+struct S;
+
+
+
+

Member Functions

+ + + + + + + + + + +
Name
store
+ + +
+
+
+

S::store

+
+
+

Synopsis

+
+Declared in <sfinae.cpp>
+
+
+void
+store(void const*);
+
+
+
+
+
+
+

S<T, std::void_t<T::a::b>>

+
+SFINAE with std::void_t + + +
+
+
+

Synopsis

+
+Declared in <sfinae.cpp>
+
+
+template<class T>
+struct S<T, std::void_t<T::a::b>>;
+
+
+
+

Member Functions

+ + + + + + + + + + +
Name
store
+ + +
+
+
+

S<T, std::void_t<T::a::b>>::store

+
+
+

Synopsis

+
+Declared in <sfinae.cpp>
+
+
+void
+store(void const*);
+
+
+
diff --git a/test-files/golden-tests/metadata/sfinae.xml b/test-files/golden-tests/metadata/sfinae.xml index 1ff7c97c34..ffa948a84b 100644 --- a/test-files/golden-tests/metadata/sfinae.xml +++ b/test-files/golden-tests/metadata/sfinae.xml @@ -222,5 +222,46 @@ + +