[Bug c++/65396] New: Function template default template arguments not merged
david at stellarscience dot com
gcc-bugzilla@gcc.gnu.org
Thu Mar 12 02:49:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65396
Bug ID: 65396
Summary: Function template default template arguments not
merged
Product: gcc
Version: 4.9.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: david at stellarscience dot com
template <typename T, T *> void f();
template <typename T, T * = nullptr> void f() {}
int main() { f<int>(); }
------------------------
gcc inaccurately rejects this program, which is violating the following
sentence from [C++11 14.1 p10]
The set of default template-arguments available for use with a template
declaration or definition is obtained by merging the default arguments from the
definition (if in scope) and all declarations in scope in the same way default
function arguments are (8.3.6).
More information about the Gcc-bugs
mailing list