[PATCH] D68923: Don't warn about missing declarations for partial template specializations
Aaron Puchert via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 31 15:13:06 PST 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rG27684ae66d55: Don't warn about missing declarations for partial template specializations (authored by aaronpuchert).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D68923/new/
https://reviews.llvm.org/D68923
Files:
clang/lib/Sema/SemaDecl.cpp
clang/test/SemaCXX/warn-missing-variable-declarations.cpp
Index: clang/test/SemaCXX/warn-missing-variable-declarations.cpp
===================================================================
--- clang/test/SemaCXX/warn-missing-variable-declarations.cpp
+++ clang/test/SemaCXX/warn-missing-variable-declarations.cpp
@@ -70,6 +70,8 @@
template<typename> constexpr int const_var_template = 0;
template<typename> static int static_var_template = 0;
+template<typename T> int var_template<T*>;
+
template int var_template<int[1]>;
int use_var_template() { return var_template<int[2]>; }
template int var_template<int[3]>;
Index: clang/lib/Sema/SemaDecl.cpp
===================================================================
--- clang/lib/Sema/SemaDecl.cpp
+++ clang/lib/Sema/SemaDecl.cpp
@@ -12523,6 +12523,7 @@
var->getDeclContext()->getRedeclContext()->isFileContext() &&
var->isExternallyVisible() && var->hasLinkage() &&
!var->isInline() && !var->getDescribedVarTemplate() &&
+ !isa<VarTemplatePartialSpecializationDecl>(var) &&
!isTemplateInstantiation(var->getTemplateSpecializationKind()) &&
!getDiagnostics().isIgnored(diag::warn_missing_variable_declarations,
var->getLocation())) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68923.241830.patch
Type: text/x-patch
Size: 1212 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200131/57a60630/attachment.bin>
More information about the cfe-commits
mailing list