From: <no...@so...> - 2002-11-03 18:19:15
|
Bugs item #632454, was opened at 2002-11-01 23:19 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=632454&group_id=2435 Category: gcc Group: None Status: Open Resolution: None Priority: 5 Submitted By: Juan Carlos Arevalo-Baeza (thejcab) Assigned to: Danny Smith (dannysmith) Summary: Wrongful compiler error Initial Comment: When compiling the attached 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: cpp_expressions<ScannerT> { ... template < typename ParserT > struct brace_block_functor { ... }; template < typename ParserT > static functor_parser<brace_block_functor<ParserT> > // line 2304 brace_block(ParserT const& parser) { return brace_block_functor<ParserT>(parser); }; ... }; ... }; --- The error (sans the "instantiated from" super-spew) says this: --- cpp_grammar.cpp:2306: type/value mismatch at argument 1 in template parameter list for `template<class FunctorT> struct spirit::functor_parser' cpp_grammar.cpp:2306: expected a type, got `brace_block_functor' 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. This is with the newest MinGW: 2.0.0-3 ---------------------------------------------------------------------- >Comment By: Juan Carlos Arevalo-Baeza (thejcab) Date: 2002-11-03 10:19 Message: Logged In: YES user_id=447726 Ok, Danny, sorry for the confusion(s). O:-) So I tried: c:\mingw\bin\g++ -O2 -ftemplate-depth-500 -o cpp_grammar.exe cpp_grammar.cpp -I g:\JCAB\Spirit - D__GTHREAD_HIDE_WIN32API Still shows the error. Salutaciones, JCAB ---------------------------------------------------------------------- Comment By: Danny Smith (dannysmith) Date: 2002-11-03 01:16 Message: Logged In: YES user_id=11494 There was a typo in my last message. The define should be: __GTHREAD_HIDE_WIN32API (not __GTTHREAD_HIDE_WIN32API). I'll test again with your cpp_grammar.cpp and spirit headers BTW, you won't be able to test the preprocessor define with a preprocessed file. :) Danny ---------------------------------------------------------------------- Comment By: Juan Carlos Arevalo-Baeza (thejcab) Date: 2002-11-02 16:47 Message: Logged In: YES user_id=447726 Danny, I just tried with your fix: c:\mingw\bin\g++ -O2 -ftemplate-depth-500 -o cpp_grammar.o -c cpp_grammar.ii - D__GTTHREAD_HIDE_WIN32API And it still shows the error. Note that this is NOT the c_grammar sample of Spirit. It's based on it, yes, but the error happens on new code. Thanks for checking, though. ---------------------------------------------------------------------- Comment By: Danny Smith (dannysmith) Date: 2002-11-02 12:37 Message: Logged In: YES user_id=11494 Add -D__GTTHREAD_HIDE_WIN32API to command line (or put define in appropriate Boost config header). I have just built the c_grammar example app from spriit- 1.5.1 with that define and succeeded. (with warning about unknown compiler). The problem is pollution with names from w32 api. I suspect one of the Token names. __GTTHREAD_HIDE_WIN32API will be defined by default in future mingw releases. I'll change status of bug report to pending, until the define is put into FSF sources. Danny Danny ---------------------------------------------------------------------- Comment By: Juan Carlos Arevalo-Baeza (thejcab) Date: 2002-11-01 23:25 Message: Logged In: YES user_id=447726 I couldn't attach the file (the program is BIG, so it would not be accepted, not even zipped). You can download it from here: http://home.JCABs-Rumblings.com/ftp/cpp_grammar_error.zip The ZIP file includes the source, preprocessed source and the error spew. Also, the line marked as 2304 in the source fragment I sent should be the line of the error: 2306. Copy-paste typo. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=632454&group_id=2435 |