This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/77618] New: warn for explicit instantiation that occurs after an explicit specialization
- From: "trippels at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 16 Sep 2016 10:40:23 +0000
- Subject: [Bug c++/77618] New: warn for explicit instantiation that occurs after an explicit specialization
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77618
Bug ID: 77618
Summary: warn for explicit instantiation that occurs after an
explicit specialization
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: trippels at gcc dot gnu.org
Target Milestone: ---
clang has a nice warning:
% cat foo.ii
template <typename T> void foo() {}
template <> void foo<int>() {}
template void foo<int>();
% clang++ -c foo.ii
foo.ii:3:15: warning: explicit instantiation of 'foo<int>' that occurs after an
explicit specialization has no effect [-Winstantiation-after-specialization]
template void foo<int>();
^
foo.ii:2:18: note: previous template specialization is here
template <> void foo<int>() {}
^
1 warning generated.
Would be nice to have in gcc, too.