public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/13736] New: [gcc-3.4 parser regression] Some compound casts rejected
@ 2004-01-19  9:11 jan at etpmod dot phys dot tue dot nl
  2004-01-19 12:19 ` [Bug c++/13736] [3.4/3.5 Regression] Parser confused on compound casts giovannibajo at libero dot it
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: jan at etpmod dot phys dot tue dot nl @ 2004-01-19  9:11 UTC (permalink / raw)
  To: gcc-bugs

The following snippet refuses to compile with the gcc-3.4 branch (and with the 
trunk, I guess). It compiles fine with previous versions. The offending line 
and work-arounds are indicated as comments. Is it the parser, or is it me? 
 
#include <string> 
 
int main() 
{ 
  using std::string; 
 
  string s1(string( (string     )("")));   // OK 
  string s2(string( (const char*)("")));   // Does not compile 
  typedef const char* charp; 
  string s3(string( (charp)("")));         // Workaround: intermediate typedef 
  string s4((string( (const char*)("")))); // Workaround: extra parenthesis 
  return 0; 
} 
 
jan@nbjapan:~/src $ g++ t.cpp 
t.cpp: In function `int main()': 
t.cpp:8: error: expected `)' before '(' token 
t.cpp:8: error: expected `,' or `...' before '(' token 
t.cpp:8: error: expected init-declarator before ')' token 
t.cpp:8: error: expected `,' or `;' before ')' token 
 
jan@nbjapan:~/src $ g++ -v 
Reading specs from /home/jan/local/gcc-3.4/lib/gcc/i686-pc-linux-gnu/3.4.0/
specs 
Configured with: ../gcc-3.4/configure --prefix=/home/jan/local/gcc-3.4 
--enable-languages=c,c++ --disable-checking 
Thread model: posix 
gcc version 3.4.0 20040119 (prerelease)

-- 
           Summary: [gcc-3.4 parser regression] Some compound casts rejected
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jan at etpmod dot phys dot tue dot nl
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: pc-linux-gnu
  GCC host triplet: pc-linux-gnu
GCC target triplet: pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13736


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

end of thread, other threads:[~2004-01-29  1:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-19  9:11 [Bug c++/13736] New: [gcc-3.4 parser regression] Some compound casts rejected jan at etpmod dot phys dot tue dot nl
2004-01-19 12:19 ` [Bug c++/13736] [3.4/3.5 Regression] Parser confused on compound casts giovannibajo at libero dot it
2004-01-19 12:28 ` pinskia at gcc dot gnu dot org
2004-01-25  3:27 ` pinskia at gcc dot gnu dot org
2004-01-29  1:29 ` cvs-commit at gcc dot gnu dot org
2004-01-29  1:34 ` cvs-commit at gcc dot gnu dot org
2004-01-29  1:35 ` mmitchel at gcc dot gnu dot org

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).