Code below builds w/o issues using earlier gcc and other compilers -
thought you might want to know about the issue.
Thanks in adv, and happy holidays.
template < class T, const int & R >
class Cat {
public:
Cat ( int );
};
template < class T, int & R >
Cat < T, R > :: Cat ( int )
{
}
extern const int myConstant = 4;
int main ()
{
Cat < float, myConstant > cat ( 2 );
return 0;
}
bash-3.00$ g++ cat.cpp
cat.cpp:13: error: invalid use of incomplete type 'class Cat<T, R>'
cat.cpp:6: error: declaration of 'class Cat<T, R>'
bash-3.00$ g++ -v
Using built-in specs.
Target: sparc-sun-solaris2.10
Configured with: ../../gcc-4.2.1/configure
Thread model: posix
gcc version 4.2.1
--
Summary: reference data template args appear to be broken in
4.2.1 ?
Product: gcc
Version: 4.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: johill at lanl dot gov
GCC build triplet: sparc-sun-solaris2.10
GCC host triplet: sparc-sun-solaris2.10
GCC target triplet: sparc-sun-solaris2.10
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34550