public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/11617] New: [3.4 regression] g++ does not report missing member functions
@ 2003-07-21 16:41 reichelt at gcc dot gnu dot org
  2003-07-21 16:46 ` [Bug c++/11617] " reichelt at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2003-07-21 16:41 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: [3.4 regression] g++ does not report missing member
                    functions
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: critical
          Priority: P1
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org

The following invalid code is accepted by mainline
(but not by gcc 2.95.x - 3.3):

----------------------------------------------
template <int> struct A
{
    static const int i=0;
};

int baz() { return A<0>::i; }

struct B {};

template <typename T> struct C
{
    virtual void bar() const { T::foo(); } // invalid for T=B, since B has no
member foo.
};

C<B> c;
-----------------------------------------

According to Phil's snapshot collection the regression was introduced
between 2003-07-14 and 2003-07-15.


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

* [Bug c++/11617] [3.4 regression] g++ does not report missing member functions
  2003-07-21 16:41 [Bug c++/11617] New: [3.4 regression] g++ does not report missing member functions reichelt at gcc dot gnu dot org
@ 2003-07-21 16:46 ` reichelt at gcc dot gnu dot org
  2003-07-21 17:03 ` bangerth at dealii dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2003-07-21 16:46 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From reichelt at gcc dot gnu dot org  2003-07-21 16:46 -------
This was almost the same code snippet as for PR 11616, so I forgot to further
reduce it. So here's a shorter testcase:

----------------------------------------------
struct B {};

template <typename T> struct C
{
    virtual void bar() const { T::foo(); }
};

C<B> c;
----------------------------------------------


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

* [Bug c++/11617] [3.4 regression] g++ does not report missing member functions
  2003-07-21 16:41 [Bug c++/11617] New: [3.4 regression] g++ does not report missing member functions reichelt at gcc dot gnu dot org
  2003-07-21 16:46 ` [Bug c++/11617] " reichelt at gcc dot gnu dot org
@ 2003-07-21 17:03 ` bangerth at dealii dot org
  2003-07-23 13:07 ` nathan at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: bangerth at dealii dot org @ 2003-07-21 17:03 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


bangerth at dealii dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |wrong-code
   Last reconfirmed|0000-00-00 00:00:00         |2003-07-21 17:03:19
               date|                            |


------- Additional Comments From bangerth at dealii dot org  2003-07-21 17:03 -------
Confirmed indeed. You left in a little cruft from the previous
example, here's something smaller:
----------------------------
struct B {};

template <typename T> struct C {
    virtual void bar() const { T::foo(); }
};

int main () {
  C<B> c;
  c.bar();
}
--------------------------------
This *compiles*, and even *executes*. Wow!

W.


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

* [Bug c++/11617] [3.4 regression] g++ does not report missing member functions
  2003-07-21 16:41 [Bug c++/11617] New: [3.4 regression] g++ does not report missing member functions reichelt at gcc dot gnu dot org
  2003-07-21 16:46 ` [Bug c++/11617] " reichelt at gcc dot gnu dot org
  2003-07-21 17:03 ` bangerth at dealii dot org
@ 2003-07-23 13:07 ` nathan at gcc dot gnu dot org
  2003-07-23 23:18 ` janis187 at us dot ibm dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: nathan at gcc dot gnu dot org @ 2003-07-23 13:07 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


nathan at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |nathan at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED


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

* [Bug c++/11617] [3.4 regression] g++ does not report missing member functions
  2003-07-21 16:41 [Bug c++/11617] New: [3.4 regression] g++ does not report missing member functions reichelt at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2003-07-23 13:07 ` nathan at gcc dot gnu dot org
@ 2003-07-23 23:18 ` janis187 at us dot ibm dot com
  2003-07-25 16:36 ` cvs-commit at gcc dot gnu dot org
  2003-07-25 16:44 ` nathan at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: janis187 at us dot ibm dot com @ 2003-07-23 23:18 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


janis187 at us dot ibm dot com changed:

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


------- Additional Comments From janis187 at us dot ibm dot com  2003-07-23 23:18 -------
The regression in PR 11617 was introduced or exposed by this patch:

--- gcc/gcc/cp/ChangeLog ---

2003-07-14  Mark Mitchell  <mark@codesourcery.com>

        PR c++/7019
        * cp-tree.h (lookup_qualified_name): Adjust prototype.
        * decl.c (lookup_qualified_name): Add complain parameter.  Adjust
        call to is_aggr_type.
        * parser.c (cp_parser_lookup_name): Adjust call to
        lookup_qualified_name.
        * pt.c (tsubst_qualified_id): Likewise.
        (tsubst_copy_and_build): Likewise.
        * semantics.c (finish_qualified_id_expr): Deal with erroneous
        expressions.

The regression hunt took place on i686-pc-linux-gnu and used the small
test case from Comment #2.


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

* [Bug c++/11617] [3.4 regression] g++ does not report missing member functions
  2003-07-21 16:41 [Bug c++/11617] New: [3.4 regression] g++ does not report missing member functions reichelt at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2003-07-23 23:18 ` janis187 at us dot ibm dot com
@ 2003-07-25 16:36 ` cvs-commit at gcc dot gnu dot org
  2003-07-25 16:44 ` nathan at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2003-07-25 16:36 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From cvs-commit at gcc dot gnu dot org  2003-07-25 16:35 -------
Subject: Bug 11617

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	nathan@gcc.gnu.org	2003-07-25 16:35:20

Modified files:
	gcc/cp         : ChangeLog cp-tree.h pt.c semantics.c 
	gcc/testsuite  : ChangeLog 
	gcc/testsuite/g++.dg/template: memclass1.C 
Added files:
	gcc/testsuite/g++.dg/template: lookup2.C 

Log message:
	cp:
	PR c++/11617
	* cp-tree.h (qualified_name_lookup_error): Declare.
	* pt.c (tsubst_qualified_id): Use qualified_name_lookup_error for
	errors.
	(tsubst_expr) <DECL_STMT case>: Likewise.
	(tsubst_copy_and_build) <COMPONENT_REF case>: Likewise.
	* semantics.c (qualified_name_lookup_error): New, broken out of ...
	(finish_id_expression): ... here. Use it.
	testsuite:
	PR c++/11617
	* g++.dg/template/lookup2.C: New test.
	* g++.dg/template/memclass1.C: Remove instantiated from error.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3554&r2=1.3555
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cp-tree.h.diff?cvsroot=gcc&r1=1.887&r2=1.888
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.736&r2=1.737
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/semantics.c.diff?cvsroot=gcc&r1=1.333&r2=1.334
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2917&r2=1.2918
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/lookup2.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/memclass1.C.diff?cvsroot=gcc&r1=1.1&r2=1.2


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

* [Bug c++/11617] [3.4 regression] g++ does not report missing member functions
  2003-07-21 16:41 [Bug c++/11617] New: [3.4 regression] g++ does not report missing member functions reichelt at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2003-07-25 16:36 ` cvs-commit at gcc dot gnu dot org
@ 2003-07-25 16:44 ` nathan at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: nathan at gcc dot gnu dot org @ 2003-07-25 16:44 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


nathan at gcc dot gnu dot org changed:

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


------- Additional Comments From nathan at gcc dot gnu dot org  2003-07-25 16:44 -------
2003-07-25  Nathan Sidwell  <nathan@codesourcery.com>

	PR c++/11617
	* cp-tree.h (qualified_name_lookup_error): Declare.
	* pt.c (tsubst_qualified_id): Use qualified_name_lookup_error for
	errors.
	(tsubst_expr) <DECL_STMT case>: Likewise.
	(tsubst_copy_and_build) <COMPONENT_REF case>: Likewise.
	* semantics.c (qualified_name_lookup_error): New, broken out of ...
	(finish_id_expression): ... here. Use it.


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

end of thread, other threads:[~2003-07-25 16:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-21 16:41 [Bug c++/11617] New: [3.4 regression] g++ does not report missing member functions reichelt at gcc dot gnu dot org
2003-07-21 16:46 ` [Bug c++/11617] " reichelt at gcc dot gnu dot org
2003-07-21 17:03 ` bangerth at dealii dot org
2003-07-23 13:07 ` nathan at gcc dot gnu dot org
2003-07-23 23:18 ` janis187 at us dot ibm dot com
2003-07-25 16:36 ` cvs-commit at gcc dot gnu dot org
2003-07-25 16:44 ` nathan 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).