public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/35138]  New: g++ rejects valid code
@ 2008-02-08 13:30 tim at klingt dot org
  2008-02-08 14:01 ` [Bug c++/35138] " tim at klingt dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: tim at klingt dot org @ 2008-02-08 13:30 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 917 bytes --]

g++-4.3 rejects the following code:

namespace n1 {
struct foo{};
}

namespace n2 {
struct foo{};
}

using namespace n1;
using namespace n2;

template <typename tp>
int run(tp const & t) {
    return t.foo;
}

struct bar {
    int foo;
};

int main() {
    bar b;

    run(b);
}

the error message is:
bug.cpp: In function ‘int run(const tp&)’:
bug.cpp:14: error: reference to ‘foo’ is ambiguous
bug.cpp:6: error: candidates are: struct n2::foo
bug.cpp:2: error:                 struct n1::foo

g++-4.1 and g++-4.2 accept the code, though ...


-- 
           Summary: g++ rejects valid code
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tim at klingt dot org


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


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

* [Bug c++/35138] g++ rejects valid code
  2008-02-08 13:30 [Bug c++/35138] New: g++ rejects valid code tim at klingt dot org
@ 2008-02-08 14:01 ` tim at klingt dot org
  2008-02-08 16:11 ` [Bug c++/35138] [4.3 Regression] " rguenth at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: tim at klingt dot org @ 2008-02-08 14:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from tim at klingt dot org  2008-02-08 14:01 -------
*** Bug 35139 has been marked as a duplicate of this bug. ***


-- 


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


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

* [Bug c++/35138] [4.3 Regression] g++ rejects valid code
  2008-02-08 13:30 [Bug c++/35138] New: g++ rejects valid code tim at klingt dot org
  2008-02-08 14:01 ` [Bug c++/35138] " tim at klingt dot org
@ 2008-02-08 16:11 ` rguenth at gcc dot gnu dot org
  2008-02-08 17:59 ` jakub at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-02-08 16:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2008-02-08 16:11 -------
Confirmed.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |rejects-valid
      Known to fail|                            |4.3.0
      Known to work|                            |4.1.2 4.2.2
   Last reconfirmed|0000-00-00 00:00:00         |2008-02-08 16:11:14
               date|                            |
            Summary|g++ rejects valid code      |[4.3 Regression] g++ rejects
                   |                            |valid code
   Target Milestone|---                         |4.3.0


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


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

* [Bug c++/35138] [4.3 Regression] g++ rejects valid code
  2008-02-08 13:30 [Bug c++/35138] New: g++ rejects valid code tim at klingt dot org
  2008-02-08 14:01 ` [Bug c++/35138] " tim at klingt dot org
  2008-02-08 16:11 ` [Bug c++/35138] [4.3 Regression] " rguenth at gcc dot gnu dot org
@ 2008-02-08 17:59 ` jakub at gcc dot gnu dot org
  2008-02-08 21:52 ` bangerth at dealii dot org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-02-08 17:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jakub at gcc dot gnu dot org  2008-02-08 17:58 -------
Caused by my http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129836
This is during tentative parse, so I guess the errors should be suppressed.


-- 


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


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

* [Bug c++/35138] [4.3 Regression] g++ rejects valid code
  2008-02-08 13:30 [Bug c++/35138] New: g++ rejects valid code tim at klingt dot org
                   ` (2 preceding siblings ...)
  2008-02-08 17:59 ` jakub at gcc dot gnu dot org
@ 2008-02-08 21:52 ` bangerth at dealii dot org
  2008-02-08 22:16 ` rguenth at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: bangerth at dealii dot org @ 2008-02-08 21:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from bangerth at dealii dot org  2008-02-08 21:51 -------
This should get higher priority than P3...


-- 


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


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

* [Bug c++/35138] [4.3 Regression] g++ rejects valid code
  2008-02-08 13:30 [Bug c++/35138] New: g++ rejects valid code tim at klingt dot org
                   ` (3 preceding siblings ...)
  2008-02-08 21:52 ` bangerth at dealii dot org
@ 2008-02-08 22:16 ` rguenth at gcc dot gnu dot org
  2008-02-11 23:12 ` jakub at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-02-08 22:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from rguenth at gcc dot gnu dot org  2008-02-08 22:15 -------
This is worse than PR32384, so either we have a fix for it or we should revert
the fix for PR32384 before 4.3.0.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |32384
              nThis|                            |
           Priority|P3                          |P1


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


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

* [Bug c++/35138] [4.3 Regression] g++ rejects valid code
  2008-02-08 13:30 [Bug c++/35138] New: g++ rejects valid code tim at klingt dot org
                   ` (4 preceding siblings ...)
  2008-02-08 22:16 ` rguenth at gcc dot gnu dot org
@ 2008-02-11 23:12 ` jakub at gcc dot gnu dot org
  2008-02-12 20:15 ` jakub at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-02-11 23:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jakub at gcc dot gnu dot org  2008-02-11 23:11 -------
cp_parser_class_name since PR20293 errors unconditionally even during tentative
parse.  Mark, is there a way to get a silent tentative parse of the optional
nested name specifier plus typename?  Or is trying to parse it tentatively
as pseudo-dtor followed by parsing it as id-expression/member access if the
former just never going to work?


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mark at gcc dot gnu dot org


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


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

* [Bug c++/35138] [4.3 Regression] g++ rejects valid code
  2008-02-08 13:30 [Bug c++/35138] New: g++ rejects valid code tim at klingt dot org
                   ` (5 preceding siblings ...)
  2008-02-11 23:12 ` jakub at gcc dot gnu dot org
@ 2008-02-12 20:15 ` jakub at gcc dot gnu dot org
  2008-02-13 22:32 ` jakub at gcc dot gnu dot org
  2008-02-13 22:33 ` jakub at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-02-12 20:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jakub at gcc dot gnu dot org  2008-02-12 20:14 -------
Posted 3 alternative patches:
http://gcc.gnu.org/ml/gcc-patches/2008-02/msg00410.html
http://gcc.gnu.org/ml/gcc-patches/2008-02/msg00418.html
http://gcc.gnu.org/ml/gcc-patches/2008-02/msg00422.html


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2008-02-08 16:11:14         |2008-02-12 20:14:24
               date|                            |


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


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

* [Bug c++/35138] [4.3 Regression] g++ rejects valid code
  2008-02-08 13:30 [Bug c++/35138] New: g++ rejects valid code tim at klingt dot org
                   ` (6 preceding siblings ...)
  2008-02-12 20:15 ` jakub at gcc dot gnu dot org
@ 2008-02-13 22:32 ` jakub at gcc dot gnu dot org
  2008-02-13 22:33 ` jakub at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-02-13 22:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from jakub at gcc dot gnu dot org  2008-02-13 22:31 -------
Subject: Bug 35138

Author: jakub
Date: Wed Feb 13 22:30:43 2008
New Revision: 132298

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=132298
Log:
        PR c++/35138
        * parser.c (cp_parser_pseudo_destructor_name): If next tokens
        are not identifier :: ~, return before calling cp_parser_type_name.

        * g++.dg/template/member8.C: New test.

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


-- 


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


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

* [Bug c++/35138] [4.3 Regression] g++ rejects valid code
  2008-02-08 13:30 [Bug c++/35138] New: g++ rejects valid code tim at klingt dot org
                   ` (7 preceding siblings ...)
  2008-02-13 22:32 ` jakub at gcc dot gnu dot org
@ 2008-02-13 22:33 ` jakub at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-02-13 22:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from jakub at gcc dot gnu dot org  2008-02-13 22:32 -------
Fixed.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2008-02-13 22:33 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-08 13:30 [Bug c++/35138] New: g++ rejects valid code tim at klingt dot org
2008-02-08 14:01 ` [Bug c++/35138] " tim at klingt dot org
2008-02-08 16:11 ` [Bug c++/35138] [4.3 Regression] " rguenth at gcc dot gnu dot org
2008-02-08 17:59 ` jakub at gcc dot gnu dot org
2008-02-08 21:52 ` bangerth at dealii dot org
2008-02-08 22:16 ` rguenth at gcc dot gnu dot org
2008-02-11 23:12 ` jakub at gcc dot gnu dot org
2008-02-12 20:15 ` jakub at gcc dot gnu dot org
2008-02-13 22:32 ` jakub at gcc dot gnu dot org
2008-02-13 22:33 ` jakub 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).