Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,8 @@ Improvements to Clang's diagnostics
false positives in exception-heavy code, though only simple patterns
are currently recognized.

- Clang now accepts ``@tparam`` comments on variable template partial
specializations. (#GH144775)

Improvements to Clang's time-trace
----------------------------------
Expand Down
8 changes: 8 additions & 0 deletions clang/lib/AST/Comment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,14 @@ void DeclInfo::fill() {
TemplateParameters = CTPSD->getTemplateParameters();
break;
}
case Decl::VarTemplatePartialSpecialization: {
const VarTemplatePartialSpecializationDecl *VTPSD =
cast<VarTemplatePartialSpecializationDecl>(CommentDecl);
Kind = VariableKind;
TemplateKind = TemplatePartialSpecialization;
TemplateParameters = VTPSD->getTemplateParameters();
break;
}
case Decl::ClassTemplateSpecialization:
Kind = ClassKind;
TemplateKind = TemplateSpecialization;
Expand Down
12 changes: 12 additions & 0 deletions clang/test/Sema/warn-documentation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1524,3 +1524,15 @@ F &f = FF; ///< \return none
// expected-warning@-1 {{'\return' command used in a comment that is not attached to a function or method declaration}}

} // namespace PR42844

#if __cplusplus >= 201402L
namespace GH144775 {
/// @brief primary template
/// @tparam T type
template <class T, class = void> constexpr auto var = T{};

/// @brief variable template partial specialization
/// @tparam T type
template <typename T> constexpr auto var<T> = T{};
} // namespace GH144775
#endif
Loading