[llvm-bugs] [Bug 31081] New: [c++17] exception-specification in explicit instantiation not required
via llvm-bugs
llvm-bugs at lists.llvm.org
Sun Nov 20 19:29:21 PST 2016
https://llvm.org/bugs/show_bug.cgi?id=31081
Bug ID: 31081
Summary: [c++17] exception-specification in explicit
instantiation not required
Product: new-bugs
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: new bugs
Assignee: unassignedbugs at nondot.org
Reporter: octoploid at yandex.com
CC: llvm-bugs at lists.llvm.org
Classification: Unclassified
except.spec/5 says:
»In an explicit instantiation an exception-specification may be specified, but
is not required.«
However clang rejects this valid code:
% cat compat.ii
template <typename T> void foo() noexcept {}
template <typename T> void bar() throw() {}
template void foo<int>();
template void bar<int>();
% clang++ -std=c++1z -c compat.ii
compat.ii:3:15: error: explicit instantiation of 'foo' does not refer to a
function template, variable template, member function, member class, or static
data member
template void foo<int>();
^
compat.ii:1:28: note: candidate template ignored: could not match 'void ()
noexcept' against 'void ()'
template <typename T> void foo() noexcept {}
^
compat.ii:4:15: error: explicit instantiation of 'bar' does not refer to a
function template, variable template, member function, member class, or static
data member
template void bar<int>();
^
compat.ii:2:28: note: candidate template ignored: could not match 'void ()
throw()' against 'void ()'
template <typename T> void bar() throw() {}
^
2 errors generated.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20161121/baf5df4f/attachment.html>
More information about the llvm-bugs
mailing list