This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
C++ regression from g++-2.95.2
- To: bug-gcc at gnu dot org
- Subject: C++ regression from g++-2.95.2
- From: Theodore Papadopoulo <Theodore dot Papadopoulo at sophia dot inria dot fr>
- Date: Tue, 16 Nov 1999 20:14:59 +0100
It seems that a regression has appeared with the current cvs
source against g++-2.95.2. The appended piece of code does not
compile any longer (agreed it uses a gnu extension...) with a strange
error message. If the template is removed from function g, or if the
call to function f is removed, then everything compiles OK...
Side Notes:
- Sorry Carlo, I have not yet used the const notation you favor.
- The error message is somewhat uncomplete: the const in the
argument list is missing.
Theo.
mururoa->/u/corse/2/robotvis/gnu/egcs/bin/g++ -v
Reading specs from /u/corse/2/robotvis/gnu/egcs/bin/../lib/gcc-lib/i686-pc-linux-gnu/2.96/specs
gcc version 2.96 19991115 (experimental)
mururoa->/u/corse/2/robotvis/gnu/egcs/bin/g++ -c TempGnuDynArray.C
TempGnuDynArray.C: In function `void g (unsigned int) [with T = double]':
TempGnuDynArray.C:17: instantiated from here
TempGnuDynArray.C:12: invalid type argument of `unary *'
mururoa->g++ -v
Reading specs from /usr/local/gcc/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/specs
gcc version 2.95.2 19991024 (release)
mururoa->g++ -c TempGnuDynArray.C
mururoa->cat TempGnuDynArray.C
// Build don't link:
// Origin: Theo Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
inline const unsigned& f(const unsigned& a) {
return a;
}
template <class T>
void
g(const unsigned n)
{
double D[f(n)];
}
int main()
{
g<double>(18);
}
--------------------------------------------------------------------
Theodore Papadopoulo
Email: Theodore.Papadopoulo@sophia.inria.fr Tel: (33) 04 92 38 76 01
--------------------------------------------------------------------