public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/20164] New: Wrong line number in diagnostic with gcc 4.0
@ 2005-02-23 18:15 micis at gmx dot de
  2005-02-23 18:21 ` [Bug c++/20164] " micis at gmx dot de
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: micis at gmx dot de @ 2005-02-23 18:15 UTC (permalink / raw)
  To: gcc-bugs

When I compile the source file given below with gcc40 I get strange warnings.
I use the snapshot 20050220, but with older snapshots i get the same results.
The function is correct but the line number is wrong.
By the way: Why is "." replaced by "$" ?

g++40 -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc40/configure --prefix=/usr/local/gcc40e --program-
suffix=40e --with-arch=opteron --enable-languages=c,c++ --enable-checking
Thread model: posix
gcc version 4.0.0 20050220 (experimental)

gcc40 -c -Wall -O2 -o MeOut.o MeOut.ii
MeOut.cpp: In member function 'void Cla::Bar2()':
MeOut.cpp:36: warning: 'p$cp$dx' is used uninitialized in this function
MeOut.cpp:36: warning: 'p$cp$oy' is used uninitialized in this function
MeOut.cpp:36: warning: 'p$cp$ox' is used uninitialized in this function
MeOut.cpp: In member function 'void Cla::Bar1()':
MeOut.cpp:36: warning: 'p$cp$dy' is used uninitialized in this function
MeOut.cpp:36: warning: 'p$cp$oy' is used uninitialized in this function
MeOut.cpp:36: warning: 'p$cp$ox' is used uninitialized in this function


=======================
#include <tao/ORB.h>

namespace ME
{
    struct  crop
    {
        int ox;
        int oy;
        int dx;
        int dy;
    };
    
    struct  Parm
    {
        TAO_String_Manager filename;
        ME::crop cp;
    };
  
} // module ME


class Cla {
public:
    void Bar1();
    void Bar2();
};


void Foo(ME::Parm x);


void Cla::Bar1()
{
    ME::Parm p;
    p.cp.dx = 0;
    Foo(p); 
}


void Cla::Bar2()
{
    ME::Parm p;
    p.cp.dy = 0;
    Foo(p);
}

-- 
           Summary: Wrong line number in diagnostic with gcc 4.0
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: micis at gmx dot de
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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


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

* [Bug c++/20164] Wrong line number in diagnostic with gcc 4.0
  2005-02-23 18:15 [Bug c++/20164] New: Wrong line number in diagnostic with gcc 4.0 micis at gmx dot de
@ 2005-02-23 18:21 ` micis at gmx dot de
  2005-02-23 18:24 ` pinskia at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: micis at gmx dot de @ 2005-02-23 18:21 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From micis at gmx dot de  2005-02-23 14:23 -------
Created an attachment (id=8263)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=8263&action=view)
preprocesd source


-- 


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


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

* [Bug c++/20164] Wrong line number in diagnostic with gcc 4.0
  2005-02-23 18:15 [Bug c++/20164] New: Wrong line number in diagnostic with gcc 4.0 micis at gmx dot de
  2005-02-23 18:21 ` [Bug c++/20164] " micis at gmx dot de
@ 2005-02-23 18:24 ` pinskia at gcc dot gnu dot org
  2005-02-23 18:27 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-02-23 18:24 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-02-23 14:30 -------
>By the way: Why is "." replaced by "$" ?
Because that would be PR 14329.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic


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


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

* [Bug c++/20164] Wrong line number in diagnostic with gcc 4.0
  2005-02-23 18:15 [Bug c++/20164] New: Wrong line number in diagnostic with gcc 4.0 micis at gmx dot de
  2005-02-23 18:21 ` [Bug c++/20164] " micis at gmx dot de
  2005-02-23 18:24 ` pinskia at gcc dot gnu dot org
@ 2005-02-23 18:27 ` pinskia at gcc dot gnu dot org
  2005-02-23 18:29 ` [Bug c++/20164] [4.0 Regression] " pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-02-23 18:27 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-02-23 14:36 -------
Hmm, werid.

-- 


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


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

* [Bug c++/20164] [4.0 Regression] Wrong line number in diagnostic with gcc 4.0
  2005-02-23 18:15 [Bug c++/20164] New: Wrong line number in diagnostic with gcc 4.0 micis at gmx dot de
                   ` (2 preceding siblings ...)
  2005-02-23 18:27 ` pinskia at gcc dot gnu dot org
@ 2005-02-23 18:29 ` pinskia at gcc dot gnu dot org
  2005-02-23 18:36 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-02-23 18:29 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-02-23 14:46 -------
Testcase:
struct temp
{
  temp(){}
  ~temp(){}
  temp(const temp&){}
};
struct crop
{
    int ox, oy, dx, dy;
};
struct Parm
{
    temp filename;
    crop cp;
};
void Foo(Parm x);
void Bar1()
{
    Parm p;
    p.cp.dx = 0;
    Foo(p);
}
void Bar2()
{
    Parm p;
    p.cp.dy = 0;
    Foo(p);
}

the problem is that Parm's copy constructor is at line 21 which is wrong.
This is a regression from earlier 4.0's where the copy constructor was not generated lazy.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mmitchel at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-02-23 14:46:15
               date|                            |
            Summary|Wrong line number in        |[4.0 Regression] Wrong line
                   |diagnostic with gcc 4.0     |number in diagnostic with
                   |                            |gcc 4.0
   Target Milestone|---                         |4.0.0


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


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

* [Bug c++/20164] [4.0 Regression] Wrong line number in diagnostic with gcc 4.0
  2005-02-23 18:15 [Bug c++/20164] New: Wrong line number in diagnostic with gcc 4.0 micis at gmx dot de
                   ` (3 preceding siblings ...)
  2005-02-23 18:29 ` [Bug c++/20164] [4.0 Regression] " pinskia at gcc dot gnu dot org
@ 2005-02-23 18:36 ` pinskia at gcc dot gnu dot org
  2005-02-25  2:48 ` [Bug c++/20164] [3.3/3.4/4.0 " pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-02-23 18:36 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-02-23 14:50 -------
Here is another testcase where the lines lines look wrong and can be shown to be a regression from 
3.4.0:
struct temp
{
  temp(){}
  temp(const temp&){}
};
struct Parm
{
    temp filename;
};
void Foo(Parm x);
void Bar1()
{
  Parm p;
  Foo(p);
}
void Bar2()
{
  temp a;
  Parm p(a);
}


-- 


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


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

* [Bug c++/20164] [3.3/3.4/4.0 Regression] Wrong line number in diagnostic with gcc 4.0
  2005-02-23 18:15 [Bug c++/20164] New: Wrong line number in diagnostic with gcc 4.0 micis at gmx dot de
                   ` (4 preceding siblings ...)
  2005-02-23 18:36 ` pinskia at gcc dot gnu dot org
@ 2005-02-25  2:48 ` pinskia at gcc dot gnu dot org
  2005-03-02 21:23 ` [Bug c++/20164] [3.3/3.4/4.0/4.1 Regression] Wrong line number in diagnostic with gcc 4.0/4.1 aoliva at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-02-25  2:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-02-24 22:02 -------
Hmm, with my example in comment #5, this is a regression from 2.95.3 and not from 3.4.0, I should 
have really tested it before saying what I thought cause the regression.

The patch which I am thinking caused this regression now is:
2000-04-08  Mark Mitchell  <mark@codesourcery.com>

        * cp-tree.h (cp_tree_index): Add CPTI_COMPLETE_CTOR_IDENTIFIER.
        (complete_ctor_identifier): New macro.
        (special_function_kind): Add sfk_copy_constructor and
        sfk_assignment_operator. 

It is not setting the locus correctly on the body of the functions.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |3.3.3 3.4.0 4.0.0
      Known to work|                            |2.95.3
            Summary|[4.0 Regression] Wrong line |[3.3/3.4/4.0 Regression]
                   |number in diagnostic with   |Wrong line number in
                   |gcc 4.0                     |diagnostic with gcc 4.0
   Target Milestone|4.0.0                       |3.4.4


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


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

* [Bug c++/20164] [3.3/3.4/4.0/4.1 Regression] Wrong line number in diagnostic with gcc 4.0/4.1
  2005-02-23 18:15 [Bug c++/20164] New: Wrong line number in diagnostic with gcc 4.0 micis at gmx dot de
                   ` (5 preceding siblings ...)
  2005-02-25  2:48 ` [Bug c++/20164] [3.3/3.4/4.0 " pinskia at gcc dot gnu dot org
@ 2005-03-02 21:23 ` aoliva at gcc dot gnu dot org
  2005-05-19 17:44 ` mmitchel at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: aoliva at gcc dot gnu dot org @ 2005-03-02 21:23 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From aoliva at gcc dot gnu dot org  2005-03-02 21:23 -------
IIRC that piece of code is supposed to mark the location of implicitly-generated
cdtors as that of the use, so as to give the user a clue of why it is being
generated.

-- 


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


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

* [Bug c++/20164] [3.3/3.4/4.0/4.1 Regression] Wrong line number in diagnostic with gcc 4.0/4.1
  2005-02-23 18:15 [Bug c++/20164] New: Wrong line number in diagnostic with gcc 4.0 micis at gmx dot de
                   ` (6 preceding siblings ...)
  2005-03-02 21:23 ` [Bug c++/20164] [3.3/3.4/4.0/4.1 Regression] Wrong line number in diagnostic with gcc 4.0/4.1 aoliva at gcc dot gnu dot org
@ 2005-05-19 17:44 ` mmitchel at gcc dot gnu dot org
  2005-07-22 21:12 ` [Bug c++/20164] [3.4/4.0/4.1 Regression] Wrong line number in diagnostic pinskia at gcc dot gnu dot org
  2005-09-27 16:18 ` mmitchel at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-05-19 17:44 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4.4                       |3.4.5


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


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

* [Bug c++/20164] [3.4/4.0/4.1 Regression] Wrong line number in diagnostic
  2005-02-23 18:15 [Bug c++/20164] New: Wrong line number in diagnostic with gcc 4.0 micis at gmx dot de
                   ` (7 preceding siblings ...)
  2005-05-19 17:44 ` mmitchel at gcc dot gnu dot org
@ 2005-07-22 21:12 ` pinskia at gcc dot gnu dot org
  2005-09-27 16:18 ` mmitchel at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-22 21:12 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-07-22 21:12 -------
Moving to 4.0.2 pre Mark.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4.5                       |4.0.2


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


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

* [Bug c++/20164] [3.4/4.0/4.1 Regression] Wrong line number in diagnostic
  2005-02-23 18:15 [Bug c++/20164] New: Wrong line number in diagnostic with gcc 4.0 micis at gmx dot de
                   ` (8 preceding siblings ...)
  2005-07-22 21:12 ` [Bug c++/20164] [3.4/4.0/4.1 Regression] Wrong line number in diagnostic pinskia at gcc dot gnu dot org
@ 2005-09-27 16:18 ` mmitchel at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-09-27 16:18 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.0.2                       |4.0.3


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


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

end of thread, other threads:[~2005-09-27 16:18 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-23 18:15 [Bug c++/20164] New: Wrong line number in diagnostic with gcc 4.0 micis at gmx dot de
2005-02-23 18:21 ` [Bug c++/20164] " micis at gmx dot de
2005-02-23 18:24 ` pinskia at gcc dot gnu dot org
2005-02-23 18:27 ` pinskia at gcc dot gnu dot org
2005-02-23 18:29 ` [Bug c++/20164] [4.0 Regression] " pinskia at gcc dot gnu dot org
2005-02-23 18:36 ` pinskia at gcc dot gnu dot org
2005-02-25  2:48 ` [Bug c++/20164] [3.3/3.4/4.0 " pinskia at gcc dot gnu dot org
2005-03-02 21:23 ` [Bug c++/20164] [3.3/3.4/4.0/4.1 Regression] Wrong line number in diagnostic with gcc 4.0/4.1 aoliva at gcc dot gnu dot org
2005-05-19 17:44 ` mmitchel at gcc dot gnu dot org
2005-07-22 21:12 ` [Bug c++/20164] [3.4/4.0/4.1 Regression] Wrong line number in diagnostic pinskia at gcc dot gnu dot org
2005-09-27 16:18 ` 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).