https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63658
Bug ID: 63658
Summary: [4.8/4.9 Regression] Using class reference as template
parameter causes compilation to fail
Product: gcc
Version: 4.9.1
Status: UNCONFIRMED
Severity: major
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: patrick.riphagen at xsens dot com
Created attachment 33818
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33818&action=edit
Source code containing the bug
We have a template class which is based on a descriptor class.
The template class is specialized later on.
I have attached a stripped version of the problematic code.
Using gcc 4.7 and 4.8 we did not have a problem compiling this code.
Using gcc 4.9.1 (gcc version 4.9.1 (Ubuntu 4.9.1-16ubuntu6) ) this code does
not compile anymore.
The error is:
main.cpp:15:17: error: prototype for ‘void foo<D>::size() [with Descriptor& D =
(* & g_descriptor)]’ does not match any in class ‘foo<(* & g_descriptor)>’
template<> void foo<g_descriptor>::size()
^
main.cpp:11:7: error: candidate is: void foo<D>::size() [with Descriptor& D =
(* & g_descriptor)]
void size ();
It looks like the prototype for and candidate look exactly the same, however
compilation still fails