public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* Bug report
@ 1998-12-10 12:43 Karl JH Millar
  1998-12-10 15:55 ` Alexandre Oliva
  1998-12-10 15:55 ` Explict typename Gerald Pfeifer
  0 siblings, 2 replies; 4+ messages in thread
From: Karl JH Millar @ 1998-12-10 12:43 UTC (permalink / raw)
  To: egcs-bugs

I get a compiler error compiling the following

template<class I, class J>
class Map {
 public:
  typedef I* iterator;
};

template<class T>
void foo(T a) {
  Map<int, T>::iterator i;
}

void bar() {
  int x;
  foo(x);
}

The result of trying to compile is

gcc -c -v template.cc -pedantic
Reading specs from /usr/local/lib/gcc-lib/i686-linux-gnu/egcs-2.91.57/specs
gcc version egcs-2.91.57 19980901 (egcs-1.1 release)
 /usr/local/lib/gcc-lib/i686-linux-gnu/egcs-2.91.57/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=91 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem(posix) -D__EXCEPTIONS -pedantic -Asystem(unix) -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -Di686 -Dpentiumpro -D__i686 -D__i686__ -D__pentiumpro -D__pentiumpro__ template.cc /tmp/ccP2gdme.ii
GNU CPP version egcs-2.91.57 19980901 (egcs-1.1 release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include/g++
 /usr/local/include
 /usr/local/i686-linux-gnu/include
 /usr/local/lib/gcc-lib/i686-linux-gnu/egcs-2.91.57/include
 /usr/include
End of search list.
 /usr/local/lib/gcc-lib/i686-linux-gnu/egcs-2.91.57/cc1plus /tmp/ccP2gdme.ii -quiet -dumpbase template.cc -pedantic -version -o /tmp/cc3GC1hi.s
GNU C++ version egcs-2.91.57 19980901 (egcs-1.1 release) (i686-linux-gnu) compiled by GNU C version egcs-2.91.57 19980901 (egcs-1.1 release).
template.cc: In function `void foo(T)':
template.cc:9: parse error before `;'

I don't get the error compiling without -pedantic.
My system is a Linux/GNU system, (version 2.1.125 of the kernel) running on a
Cyrix PR 200MX processor. The egcs version is egcs-1.1a (egcs-2.91.57 19980901)
I don't know off hand the options I passed to configure, but it was nothing
unusual.

Karl Millar.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1998-12-11  5:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-12-10 12:43 Bug report Karl JH Millar
1998-12-10 15:55 ` Alexandre Oliva
1998-12-10 15:55 ` Explict typename Gerald Pfeifer
1998-12-11  5:11   ` Gabriel Dos Reis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).