[Bug c++/37862] Parenthesised indirection alters class member access

2009-02-10 Thread jason at gcc dot gnu dot org


--- Comment #7 from jason at gcc dot gnu dot org  2009-02-10 23:11 ---
Fixed.


-- 

jason at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution||FIXED


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



[Bug c++/37862] Parenthesised indirection alters class member access

2009-01-14 Thread nickc at gcc dot gnu dot org


--- Comment #6 from nickc at gcc dot gnu dot org  2009-01-14 13:00 ---
Subject: Bug 37862

Author: nickc
Date: Wed Jan 14 13:00:21 2009
New Revision: 143369

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=143369
Log:
PR c++/37862
* parser.c: Pass cp_id_kind computed in
cp_parser_postfix_dot_deref_expression to
cp_parser_primary_expression.

* g++.cp/parse/pr37862.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/parse/pr37862.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/parser.c
trunk/gcc/testsuite/ChangeLog


-- 


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



[Bug c++/37862] Parenthesised indirection alters class member access

2008-11-10 Thread nickc at redhat dot com


--- Comment #3 from nickc at redhat dot com  2008-11-10 13:49 ---
Hi Guys,

  I have uploaded a potential patch for the problem.  It fixes the testcase
originally provided and does not introduce any regressions into the g++
testsuite for an i686-pc-linux-gnu toolchain.  

That's the good news.  The bad news is that I am not sure if the patch will be
acceptable since I am not a C++ expert.  The problem I believe is that the
status of the cp_id_kind enum which is computed by
cp_parser_postfix_dot_deref_expression() when it is parsing A::get is not
passed back to cp_parse_primary_expression() which is currently parsing
(p-A::get).  So it goes with its default value, which allows overloading of
virtual functions, and so the wrong member function is selected.

The patch attempts to fix this problem by allowing the cp_id_kind enum computed
in cp_parser_postfix_dot_deref_expression to be passes back, via a long chain
of intermediary functions, to cp_parser_primary_expression.  My concern is that
I am not familiar enough with the C++ parser to tell if the patch breaks some
other parser requirement.  (One that is not tested by the g++ testsuite).

So - is this patch acceptable ?

Cheers
  Nick


-- 

nickc at redhat dot com changed:

   What|Removed |Added

 Status|NEW |WAITING


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



[Bug c++/37862] Parenthesised indirection alters class member access

2008-11-10 Thread nickc at redhat dot com


--- Comment #4 from nickc at redhat dot com  2008-11-10 16:22 ---
Created an attachment (id=16645)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16645action=view)
Testcase for the bug


-- 


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



[Bug c++/37862] Parenthesised indirection alters class member access

2008-11-10 Thread nickc at redhat dot com


--- Comment #5 from nickc at redhat dot com  2008-11-10 16:22 ---
Oops - almost forgot - the bug needs a testcase for the g++ testsuite, so I
have uploaded a patch to add that as well.

Cheers
  Nick


-- 


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



[Bug c++/37862] Parenthesised indirection alters class member access

2008-11-10 Thread nickc at redhat dot com


--- Comment #2 from nickc at redhat dot com  2008-11-10 13:36 ---
Created an attachment (id=16644)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16644action=view)
Allow postfix parser to pass cp_id_kind information back to the primary parser


-- 


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



[Bug c++/37862] Parenthesised indirection alters class member access

2008-10-18 Thread rguenth at gcc dot gnu dot org


--- Comment #1 from rguenth at gcc dot gnu dot org  2008-10-18 11:11 ---
Confirmed.


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||rguenth at gcc dot gnu dot
   ||org
 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
   Keywords||wrong-code
   Last reconfirmed|-00-00 00:00:00 |2008-10-18 11:11:07
   date||


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