public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/41038]  New: Parsing error related to qualified name id
@ 2009-08-12  0:13 davidxl at gcc dot gnu dot org
  2009-08-12  9:55 ` [Bug c++/41038] [4.4/4.5 regression] " redi at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: davidxl at gcc dot gnu dot org @ 2009-08-12  0:13 UTC (permalink / raw)
  To: gcc-bugs

The following code compiles ok with -DOK1 or -DOK2. The default case generate
the following error which seems wrong.

gmo2.cc: In member function 'int Packer<T>::foo()':
gmo2.cc:17:29: error: request for member 'size' in 'Packer::var', which is of
non-class type 'const std::string&'



#include <string>
template <typename T>
struct base {
 const std::string& var;
};

template<typename T>
struct Packer 
 : public base<T> 
 {
 int foo() {
#ifdef OK1
      return  Packer<T>::size;
#elif defined (OK2)
     return base<T>::var.size();
#else
     return  Packer<T>::var.size();
#endif
 }
 const std::string& var;
 const int& size;
};


-- 
           Summary: Parsing error related to qualified name id
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: davidxl at gcc dot gnu dot org


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


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

* [Bug c++/41038] [4.4/4.5 regression] Parsing error related to qualified name id
  2009-08-12  0:13 [Bug c++/41038] New: Parsing error related to qualified name id davidxl at gcc dot gnu dot org
@ 2009-08-12  9:55 ` redi at gcc dot gnu dot org
  2009-08-12 18:42 ` crowl at google dot com
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: redi at gcc dot gnu dot org @ 2009-08-12  9:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from redi at gcc dot gnu dot org  2009-08-12 09:55 -------
reduced:

struct S
{
    int size() const;
};

template<typename T>
struct Packer
{
    int foo() {
        return  Packer::var.size();
    }
    const S& var;
};


-- 

redi at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |4.4.1 4.5.0
      Known to work|                            |4.3.4
            Summary|Parsing error related to    |[4.4/4.5 regression] Parsing
                   |qualified name id           |error related to qualified
                   |                            |name id


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


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

* [Bug c++/41038] [4.4/4.5 regression] Parsing error related to qualified name id
  2009-08-12  0:13 [Bug c++/41038] New: Parsing error related to qualified name id davidxl at gcc dot gnu dot org
  2009-08-12  9:55 ` [Bug c++/41038] [4.4/4.5 regression] " redi at gcc dot gnu dot org
@ 2009-08-12 18:42 ` crowl at google dot com
  2009-08-25  4:25 ` bangerth at gmail dot com
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: crowl at google dot com @ 2009-08-12 18:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from crowl at google dot com  2009-08-12 18:42 -------
It looks like the compiler is not properly handling injected class names.  The
original example was not the best use of the injected class name, but should be
accepted.  Jonathan's example is better code, and still shows the problem.

The workaround is to drop the qualifier.  Since the base is public, its member
will be found.


-- 


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


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

* [Bug c++/41038] [4.4/4.5 regression] Parsing error related to qualified name id
  2009-08-12  0:13 [Bug c++/41038] New: Parsing error related to qualified name id davidxl at gcc dot gnu dot org
  2009-08-12  9:55 ` [Bug c++/41038] [4.4/4.5 regression] " redi at gcc dot gnu dot org
  2009-08-12 18:42 ` crowl at google dot com
@ 2009-08-25  4:25 ` bangerth at gmail dot com
  2009-08-25 15:48 ` jsm28 at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: bangerth at gmail dot com @ 2009-08-25  4:25 UTC (permalink / raw)
  To: gcc-bugs



-- 

bangerth at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bangerth at gmail dot com
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-08-25 04:25:03
               date|                            |


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


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

* [Bug c++/41038] [4.4/4.5 regression] Parsing error related to qualified name id
  2009-08-12  0:13 [Bug c++/41038] New: Parsing error related to qualified name id davidxl at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2009-08-25  4:25 ` bangerth at gmail dot com
@ 2009-08-25 15:48 ` jsm28 at gcc dot gnu dot org
  2009-08-31 21:53 ` mmitchel at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2009-08-25 15:48 UTC (permalink / raw)
  To: gcc-bugs



-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.4.2


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


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

* [Bug c++/41038] [4.4/4.5 regression] Parsing error related to qualified name id
  2009-08-12  0:13 [Bug c++/41038] New: Parsing error related to qualified name id davidxl at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2009-08-25 15:48 ` jsm28 at gcc dot gnu dot org
@ 2009-08-31 21:53 ` mmitchel at gcc dot gnu dot org
  2009-10-07 14:57 ` jason at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2009-08-31 21:53 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1


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


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

* [Bug c++/41038] [4.4/4.5 regression] Parsing error related to qualified name id
  2009-08-12  0:13 [Bug c++/41038] New: Parsing error related to qualified name id davidxl at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2009-08-31 21:53 ` mmitchel at gcc dot gnu dot org
@ 2009-10-07 14:57 ` jason at gcc dot gnu dot org
  2009-10-07 18:56 ` jason at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-10-07 14:57 UTC (permalink / raw)
  To: gcc-bugs



-- 

jason at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jason at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2009-08-25 04:25:03         |2009-10-07 14:57:24
               date|                            |


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


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

* [Bug c++/41038] [4.4/4.5 regression] Parsing error related to qualified name id
  2009-08-12  0:13 [Bug c++/41038] New: Parsing error related to qualified name id davidxl at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2009-10-07 14:57 ` jason at gcc dot gnu dot org
@ 2009-10-07 18:56 ` jason at gcc dot gnu dot org
  2009-10-07 19:32 ` jason at gcc dot gnu dot org
  2009-10-07 19:33 ` jason at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-10-07 18:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jason at gcc dot gnu dot org  2009-10-07 18:56 -------
Subject: Bug 41038

Author: jason
Date: Wed Oct  7 18:56:28 2009
New Revision: 152536

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=152536
Log:
        PR c++/41038
        * tree.c (build_qualified_name): Call convert_from_reference.

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


-- 


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


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

* [Bug c++/41038] [4.4/4.5 regression] Parsing error related to qualified name id
  2009-08-12  0:13 [Bug c++/41038] New: Parsing error related to qualified name id davidxl at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2009-10-07 18:56 ` jason at gcc dot gnu dot org
@ 2009-10-07 19:32 ` jason at gcc dot gnu dot org
  2009-10-07 19:33 ` jason at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-10-07 19:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jason at gcc dot gnu dot org  2009-10-07 19:32 -------
Subject: Bug 41038

Author: jason
Date: Wed Oct  7 19:31:56 2009
New Revision: 152538

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=152538
Log:
        PR c++/39863
        * pt.c (tsubst_pack_expansion): Don't do anything now if we
        have incomplete packs of different lengths.

        PR c++/41038
        * tree.c (build_qualified_name): Call convert_from_reference.

        * pt.c (register_specialization): Push DECL_SOURCE_LOCATION to the
        clones.

        * decl.c (grok_special_member_properties): Only adjust
        TYPE_HAS_COMPLEX_* if the function is defaulted in the class body.
        (cp_finish_decl): Push DECL_DELETED_FN/DECL_DEFAULTED_FN to the
        clones.


Added:
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/cpp0x/defaulted13.C
      - copied unchanged from r152373,
trunk/gcc/testsuite/g++.dg/cpp0x/defaulted13.C
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/cpp0x/variadic95.C
      - copied unchanged from r152537,
trunk/gcc/testsuite/g++.dg/cpp0x/variadic95.C
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/template/scope3.C
      - copied unchanged from r152537,
trunk/gcc/testsuite/g++.dg/template/scope3.C
Modified:
    branches/gcc-4_4-branch/gcc/cp/ChangeLog
    branches/gcc-4_4-branch/gcc/cp/decl.c
    branches/gcc-4_4-branch/gcc/cp/pt.c
    branches/gcc-4_4-branch/gcc/cp/tree.c
    branches/gcc-4_4-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/41038] [4.4/4.5 regression] Parsing error related to qualified name id
  2009-08-12  0:13 [Bug c++/41038] New: Parsing error related to qualified name id davidxl at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2009-10-07 19:32 ` jason at gcc dot gnu dot org
@ 2009-10-07 19:33 ` jason at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-10-07 19:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jason at gcc dot gnu dot org  2009-10-07 19:33 -------
Fixed for 4.4.2 and 4.5.


-- 

jason at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2009-10-07 19:33 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-12  0:13 [Bug c++/41038] New: Parsing error related to qualified name id davidxl at gcc dot gnu dot org
2009-08-12  9:55 ` [Bug c++/41038] [4.4/4.5 regression] " redi at gcc dot gnu dot org
2009-08-12 18:42 ` crowl at google dot com
2009-08-25  4:25 ` bangerth at gmail dot com
2009-08-25 15:48 ` jsm28 at gcc dot gnu dot org
2009-08-31 21:53 ` mmitchel at gcc dot gnu dot org
2009-10-07 14:57 ` jason at gcc dot gnu dot org
2009-10-07 18:56 ` jason at gcc dot gnu dot org
2009-10-07 19:32 ` jason at gcc dot gnu dot org
2009-10-07 19:33 ` jason 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).