c++/8442: Wrongful compiler error - file available

jcab@JCABs-Rumblings.com jcab@JCABs-Rumblings.com
Sun Nov 3 17:56:00 GMT 2002

>Number:         8442
>Category:       c++
>Synopsis:       Wrongful compiler error - file available
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Sun Nov 03 17:56:00 PST 2002
>Originator:     jcab@JCABs-Rumblings.com
>Release:        MinGW 2.0.0-3 (GCC 3.2)
Windows 2000, MinGW 2.0.0-3, Spirit 1.5.1 (latest CVS)
You can download the file from here:


It's a ZIP archive including the preprocessed .ii file, the original C++ source file, and the error spew.

You can read the tracking of the bug so far on the MinGW pages in SourceForge:


Basically, when compiling the file, using this command: 

c:\mingw\bin\g++ -O2 -ftemplate-depth-500 -o 
cpp_grammar.o -c cpp_grammar.ii 

I get an error in a piece of code that looks like this: 

struct cpp_grammar: grammar<cpp_grammar> { 


template <typename ScannerT> 
struct definition: 
template < typename ParserT > 
struct brace_block_functor { 

template < typename ParserT > 
functor_parser<brace_block_functor<ParserT> > // 
line 2306 
brace_block(ParserT const& parser) { 
return brace_block_functor<ParserT>(parser); 

The error (sans the "instantiated from" super-spew) says 

cpp_grammar.cpp:2306: type/value mismatch at 
argument 1 in template parameter 
list for `template<class FunctorT> struct 
cpp_grammar.cpp:2306: expected a type, got 
cpp_grammar.cpp:2306: confused by earlier errors, 
bailing out 

This is patently wrong. In fact, I have a CygWin with 
GCC 3.0.3 that compiles this program perfectly. 

In tracking this with the MinGW people, they've tried this file with the newest 3.3 compiler, and gotten other errors.
Compile the cpp_grammar.ii file from the ZIP file above, using the following command line:

c:\mingw\bin\g++ -O2 -ftemplate-depth-500 -o 
cpp_grammar.o -c cpp_grammar.ii 


More information about the Gcc-bugs mailing list