public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/34094]  New: Undefined static data member can acquire a definition anyway
@ 2007-11-14 18:43 simon_baldwin at yahoo dot com
  2007-11-14 19:21 ` [Bug c++/34094] Undefined static data member in anonymous namespace " pinskia at gcc dot gnu dot org
                   ` (20 more replies)
  0 siblings, 21 replies; 22+ messages in thread
From: simon_baldwin at yahoo dot com @ 2007-11-14 18:43 UTC (permalink / raw)
  To: gcc-bugs

The following program should fail to link, since <anonymous>::B::x is declared
but not defined.  However, the program compiles, links, and runs with gcc 4.2.1
and with a relatively recent 4.3 snapshot.

This same program fails to build under gcc 4.1 and earlier, icc 8.1, and Comeau
test drive.

struct A {
  A(void *) {}
};

namespace {

struct B : public A {
  B() : A(&x) {}
  static int x;  // declared, but never defined
};

}

int main() {
  B::x = 0;
}


-- 
           Summary: Undefined static data member can acquire a definition
                    anyway
           Product: gcc
           Version: 4.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: simon_baldwin at yahoo dot com


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


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

* [Bug c++/34094] Undefined static data member in anonymous namespace can acquire a definition anyway
  2007-11-14 18:43 [Bug c++/34094] New: Undefined static data member can acquire a definition anyway simon_baldwin at yahoo dot com
@ 2007-11-14 19:21 ` pinskia at gcc dot gnu dot org
  2007-11-15  4:40 ` bangerth at dealii dot org
                   ` (19 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-11-14 19:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2007-11-14 19:21 -------
IIRC this is not required to be diagnostic anyways.  What is happening is that
we now mark the static data member as local to the TU which forces it to be
outputted.

This is only an issue in an anonymous namespace.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Undefined static data member|Undefined static data member
                   |can acquire a definition    |in anonymous namespace can
                   |anyway                      |acquire a definition anyway


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


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

* [Bug c++/34094] Undefined static data member in anonymous namespace can acquire a definition anyway
  2007-11-14 18:43 [Bug c++/34094] New: Undefined static data member can acquire a definition anyway simon_baldwin at yahoo dot com
  2007-11-14 19:21 ` [Bug c++/34094] Undefined static data member in anonymous namespace " pinskia at gcc dot gnu dot org
@ 2007-11-15  4:40 ` bangerth at dealii dot org
  2007-11-15 19:56 ` simon_baldwin at yahoo dot com
                   ` (18 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: bangerth at dealii dot org @ 2007-11-15  4:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from bangerth at dealii dot org  2007-11-15 04:40 -------
It may also be that the compiler sees that the store is dead and
removes it. Did you check whether the store appears in the assembler
output?

W.


-- 

bangerth at dealii dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bangerth at dealii dot org


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


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

* [Bug c++/34094] Undefined static data member in anonymous namespace can acquire a definition anyway
  2007-11-14 18:43 [Bug c++/34094] New: Undefined static data member can acquire a definition anyway simon_baldwin at yahoo dot com
  2007-11-14 19:21 ` [Bug c++/34094] Undefined static data member in anonymous namespace " pinskia at gcc dot gnu dot org
  2007-11-15  4:40 ` bangerth at dealii dot org
@ 2007-11-15 19:56 ` simon_baldwin at yahoo dot com
  2007-11-19  5:22 ` [Bug c++/34094] [4.2/4.3 Regression] " pinskia at gcc dot gnu dot org
                   ` (17 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: simon_baldwin at yahoo dot com @ 2007-11-15 19:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from simon_baldwin at yahoo dot com  2007-11-15 19:55 -------
The definition's really there in 4.2.1, absent in 4.1.1:

$ 4.2.1/g++ -S ns1.cc && c++filt <ns1.s | grep B::x
        movl    $0, (anonymous namespace)::B::x
        .local  (anonymous namespace)::B::x
        .comm   (anonymous namespace)::B::x,4,4

$ 4.1.1/g++ -S ns1.cc && c++filt <ns1.s | grep B::x
        movl    $0, (anonymous namespace)::B::x


-- 


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


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

* [Bug c++/34094] [4.2/4.3 Regression] Undefined static data member in anonymous namespace can acquire a definition anyway
  2007-11-14 18:43 [Bug c++/34094] New: Undefined static data member can acquire a definition anyway simon_baldwin at yahoo dot com
                   ` (2 preceding siblings ...)
  2007-11-15 19:56 ` simon_baldwin at yahoo dot com
@ 2007-11-19  5:22 ` pinskia at gcc dot gnu dot org
  2007-11-20 18:01 ` jakub at gcc dot gnu dot org
                   ` (16 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-11-19  5:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2007-11-19 05:22 -------
Confirmed.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |wrong-code
   Last reconfirmed|0000-00-00 00:00:00         |2007-11-19 05:22:22
               date|                            |
            Summary|Undefined static data member|[4.2/4.3 Regression]
                   |in anonymous namespace can  |Undefined static data member
                   |acquire a definition anyway |in anonymous namespace can
                   |                            |acquire a definition anyway
   Target Milestone|---                         |4.2.3


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


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

* [Bug c++/34094] [4.2/4.3 Regression] Undefined static data member in anonymous namespace can acquire a definition anyway
  2007-11-14 18:43 [Bug c++/34094] New: Undefined static data member can acquire a definition anyway simon_baldwin at yahoo dot com
                   ` (3 preceding siblings ...)
  2007-11-19  5:22 ` [Bug c++/34094] [4.2/4.3 Regression] " pinskia at gcc dot gnu dot org
@ 2007-11-20 18:01 ` jakub at gcc dot gnu dot org
  2007-11-22 14:06 ` jakub at gcc dot gnu dot org
                   ` (15 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-11-20 18:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jakub at gcc dot gnu dot org  2007-11-20 18:00 -------
Testing a fix.


-- 

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|2007-11-19 05:22:22         |2007-11-20 18:00:56
               date|                            |


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


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

* [Bug c++/34094] [4.2/4.3 Regression] Undefined static data member in anonymous namespace can acquire a definition anyway
  2007-11-14 18:43 [Bug c++/34094] New: Undefined static data member can acquire a definition anyway simon_baldwin at yahoo dot com
                   ` (4 preceding siblings ...)
  2007-11-20 18:01 ` jakub at gcc dot gnu dot org
@ 2007-11-22 14:06 ` jakub at gcc dot gnu dot org
  2007-11-22 14:07 ` [Bug c++/34094] [4.2 " jakub at gcc dot gnu dot org
                   ` (14 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-11-22 14:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jakub at gcc dot gnu dot org  2007-11-22 14:06 -------
Subject: Bug 34094

Author: jakub
Date: Thu Nov 22 14:06:06 2007
New Revision: 130351

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=130351
Log:
        PR c++/34094
        * decl2.c (cp_write_global_declarations): Issue error about static
        data members in anonymous namespace which are declared and used,
        but not defined.

        * g++.dg/ext/visibility/anon7.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/ext/visibility/anon7.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/decl2.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/34094] [4.2 Regression] Undefined static data member in anonymous namespace can acquire a definition anyway
  2007-11-14 18:43 [Bug c++/34094] New: Undefined static data member can acquire a definition anyway simon_baldwin at yahoo dot com
                   ` (5 preceding siblings ...)
  2007-11-22 14:06 ` jakub at gcc dot gnu dot org
@ 2007-11-22 14:07 ` jakub at gcc dot gnu dot org
  2007-11-25 20:46 ` pinskia at gcc dot gnu dot org
                   ` (13 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-11-22 14:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jakub at gcc dot gnu dot org  2007-11-22 14:07 -------
Fixed on the trunk.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.2/4.3 Regression]        |[4.2 Regression] Undefined
                   |Undefined static data member|static data member in
                   |in anonymous namespace can  |anonymous namespace can
                   |acquire a definition anyway |acquire a definition anyway


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


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

* [Bug c++/34094] [4.2 Regression] Undefined static data member in anonymous namespace can acquire a definition anyway
  2007-11-14 18:43 [Bug c++/34094] New: Undefined static data member can acquire a definition anyway simon_baldwin at yahoo dot com
                   ` (6 preceding siblings ...)
  2007-11-22 14:07 ` [Bug c++/34094] [4.2 " jakub at gcc dot gnu dot org
@ 2007-11-25 20:46 ` pinskia at gcc dot gnu dot org
  2007-12-11  8:42 ` jakub at gcc dot gnu dot org
                   ` (12 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-11-25 20:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from pinskia at gcc dot gnu dot org  2007-11-25 20:46 -------
Here is a testcase which shows this is not a complete fix, it does not fix the
case where the static const was initialized inside the class.

namespace {
 struct c
{
  static const bool t = 0;
};
}

const bool &f()
{
  return c::t;
}

int main(void)
{
  return 0;
}


-- 


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


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

* [Bug c++/34094] [4.2 Regression] Undefined static data member in anonymous namespace can acquire a definition anyway
  2007-11-14 18:43 [Bug c++/34094] New: Undefined static data member can acquire a definition anyway simon_baldwin at yahoo dot com
                   ` (7 preceding siblings ...)
  2007-11-25 20:46 ` pinskia at gcc dot gnu dot org
@ 2007-12-11  8:42 ` jakub at gcc dot gnu dot org
  2007-12-11  8:48 ` jakub at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-12-11  8:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from jakub at gcc dot gnu dot org  2007-12-11 08:41 -------
On Mark's request I have reverted this fix.
I'll attach a patch against trunk which errors in cases where ld would error.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at redhat dot com
           Keywords|wrong-code                  |accepts-invalid


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


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

* [Bug c++/34094] [4.2 Regression] Undefined static data member in anonymous namespace can acquire a definition anyway
  2007-11-14 18:43 [Bug c++/34094] New: Undefined static data member can acquire a definition anyway simon_baldwin at yahoo dot com
                   ` (8 preceding siblings ...)
  2007-12-11  8:42 ` jakub at gcc dot gnu dot org
@ 2007-12-11  8:48 ` jakub at gcc dot gnu dot org
  2007-12-11  8:49 ` [Bug c++/34094] [4.2/4.3 " jakub at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-12-11  8:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from jakub at gcc dot gnu dot org  2007-12-11 08:48 -------
Created an attachment (id=14723)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14723&action=view)
gcc43-pr34094.patch


-- 


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


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

* [Bug c++/34094] [4.2/4.3 Regression] Undefined static data member in anonymous namespace can acquire a definition anyway
  2007-11-14 18:43 [Bug c++/34094] New: Undefined static data member can acquire a definition anyway simon_baldwin at yahoo dot com
                   ` (9 preceding siblings ...)
  2007-12-11  8:48 ` jakub at gcc dot gnu dot org
@ 2007-12-11  8:49 ` jakub at gcc dot gnu dot org
  2007-12-12 20:57 ` mmitchel at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-12-11  8:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from jakub at gcc dot gnu dot org  2007-12-11 08:48 -------
Unassigning myself.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|jakub at gcc dot gnu dot org|unassigned at gcc dot gnu
                   |                            |dot org
             Status|ASSIGNED                    |NEW
            Summary|[4.2 Regression] Undefined  |[4.2/4.3 Regression]
                   |static data member in       |Undefined static data member
                   |anonymous namespace can     |in anonymous namespace can
                   |acquire a definition anyway |acquire a definition anyway


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


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

* [Bug c++/34094] [4.2/4.3 Regression] Undefined static data member in anonymous namespace can acquire a definition anyway
  2007-11-14 18:43 [Bug c++/34094] New: Undefined static data member can acquire a definition anyway simon_baldwin at yahoo dot com
                   ` (10 preceding siblings ...)
  2007-12-11  8:49 ` [Bug c++/34094] [4.2/4.3 " jakub at gcc dot gnu dot org
@ 2007-12-12 20:57 ` mmitchel at gcc dot gnu dot org
  2007-12-18 23:47 ` crowl at google dot com
                   ` (8 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-12-12 20:57 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


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


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

* [Bug c++/34094] [4.2/4.3 Regression] Undefined static data member in anonymous namespace can acquire a definition anyway
  2007-11-14 18:43 [Bug c++/34094] New: Undefined static data member can acquire a definition anyway simon_baldwin at yahoo dot com
                   ` (11 preceding siblings ...)
  2007-12-12 20:57 ` mmitchel at gcc dot gnu dot org
@ 2007-12-18 23:47 ` crowl at google dot com
  2007-12-18 23:52 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: crowl at google dot com @ 2007-12-18 23:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from crowl at google dot com  2007-12-18 23:46 -------
I think the last fix is incomplete:

namespace {
        struct simple  { static const int size = 4; };
    template< typename T >
        struct generic { static const int size = 4; };
}

struct instantiate {
    simple         simple_var;
    generic< int > generic_var;
};

member.cc:4: error: static data member '<unnamed>::generic<int>::size' used,
but not defined

Note that the simple class is correct, but the template instance is not.


-- 


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


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

* [Bug c++/34094] [4.2/4.3 Regression] Undefined static data member in anonymous namespace can acquire a definition anyway
  2007-11-14 18:43 [Bug c++/34094] New: Undefined static data member can acquire a definition anyway simon_baldwin at yahoo dot com
                   ` (12 preceding siblings ...)
  2007-12-18 23:47 ` crowl at google dot com
@ 2007-12-18 23:52 ` pinskia at gcc dot gnu dot org
  2008-02-01 17:02 ` jsm28 at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-12-18 23:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from pinskia at gcc dot gnu dot org  2007-12-18 23:52 -------
(In reply to comment #12)
> Note that the simple class is correct, but the template instance is not.

Well it was reverted :).  See PR 34238 for the reasons why.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |34238


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


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

* [Bug c++/34094] [4.2/4.3 Regression] Undefined static data member in anonymous namespace can acquire a definition anyway
  2007-11-14 18:43 [Bug c++/34094] New: Undefined static data member can acquire a definition anyway simon_baldwin at yahoo dot com
                   ` (13 preceding siblings ...)
  2007-12-18 23:52 ` pinskia at gcc dot gnu dot org
@ 2008-02-01 17:02 ` jsm28 at gcc dot gnu dot org
  2008-02-10 16:34 ` jason at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-02-01 17:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from jsm28 at gcc dot gnu dot org  2008-02-01 16:55 -------
4.2.3 is being released now, changing milestones of open bugs to 4.2.4.


-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.2.3                       |4.2.4


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


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

* [Bug c++/34094] [4.2/4.3 Regression] Undefined static data member in anonymous namespace can acquire a definition anyway
  2007-11-14 18:43 [Bug c++/34094] New: Undefined static data member can acquire a definition anyway simon_baldwin at yahoo dot com
                   ` (14 preceding siblings ...)
  2008-02-01 17:02 ` jsm28 at gcc dot gnu dot org
@ 2008-02-10 16:34 ` jason at gcc dot gnu dot org
  2008-02-10 18:13 ` jason at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: jason at gcc dot gnu dot org @ 2008-02-10 16:34 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|2007-11-20 18:00:56         |2008-02-10 16:34:00
               date|                            |


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


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

* [Bug c++/34094] [4.2/4.3 Regression] Undefined static data member in anonymous namespace can acquire a definition anyway
  2007-11-14 18:43 [Bug c++/34094] New: Undefined static data member can acquire a definition anyway simon_baldwin at yahoo dot com
                   ` (15 preceding siblings ...)
  2008-02-10 16:34 ` jason at gcc dot gnu dot org
@ 2008-02-10 18:13 ` jason at gcc dot gnu dot org
  2008-02-12  6:39 ` jason at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: jason at gcc dot gnu dot org @ 2008-02-10 18:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from jason at gcc dot gnu dot org  2008-02-10 18:12 -------
Subject: Bug 34094

Author: jason
Date: Sun Feb 10 18:12:01 2008
New Revision: 132218

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=132218
Log:
        PR c++/34094
        * decl2.c (cp_write_global_declarations): Don't write out static
        data members with DECL_IN_AGGR_P set.

Added:
    trunk/gcc/testsuite/g++.dg/other/anon5.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/decl2.c


-- 


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


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

* [Bug c++/34094] [4.2/4.3 Regression] Undefined static data member in anonymous namespace can acquire a definition anyway
  2007-11-14 18:43 [Bug c++/34094] New: Undefined static data member can acquire a definition anyway simon_baldwin at yahoo dot com
                   ` (16 preceding siblings ...)
  2008-02-10 18:13 ` jason at gcc dot gnu dot org
@ 2008-02-12  6:39 ` jason at gcc dot gnu dot org
  2008-02-12  6:42 ` jason at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: jason at gcc dot gnu dot org @ 2008-02-12  6:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from jason at gcc dot gnu dot org  2008-02-12 06:38 -------
Subject: Bug 34094

Author: jason
Date: Tue Feb 12 06:37:34 2008
New Revision: 132254

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=132254
Log:
        PR c++/34094
        * decl2.c (cp_write_global_declarations): Don't write out static
        data members with DECL_IN_AGGR_P set.

        PR c++/33916
        * Revert:
        2006-10-17  Mark Mitchell  <mark@codesourcery.com>
        PR c++/29039
        * typeck2.c (build_functional_cast): Don't zero-initialize
        non-PODs; instead, call their constructors.

Removed:
    branches/gcc-4_2-branch/gcc/testsuite/g++.dg/init/ctor8.C
Modified:
    branches/gcc-4_2-branch/gcc/cp/ChangeLog
    branches/gcc-4_2-branch/gcc/cp/decl2.c
    branches/gcc-4_2-branch/gcc/cp/typeck2.c
    branches/gcc-4_2-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/34094] [4.2/4.3 Regression] Undefined static data member in anonymous namespace can acquire a definition anyway
  2007-11-14 18:43 [Bug c++/34094] New: Undefined static data member can acquire a definition anyway simon_baldwin at yahoo dot com
                   ` (17 preceding siblings ...)
  2008-02-12  6:39 ` jason at gcc dot gnu dot org
@ 2008-02-12  6:42 ` jason at gcc dot gnu dot org
  2008-02-22 17:51 ` pinskia at gcc dot gnu dot org
  2008-02-22 18:04 ` jason at gcc dot gnu dot org
  20 siblings, 0 replies; 22+ messages in thread
From: jason at gcc dot gnu dot org @ 2008-02-12  6:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from jason at gcc dot gnu dot org  2008-02-12 06:41 -------
Fixed for 4.3.0 and 4.2.4.


-- 

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=34094


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

* [Bug c++/34094] [4.2/4.3 Regression] Undefined static data member in anonymous namespace can acquire a definition anyway
  2007-11-14 18:43 [Bug c++/34094] New: Undefined static data member can acquire a definition anyway simon_baldwin at yahoo dot com
                   ` (18 preceding siblings ...)
  2008-02-12  6:42 ` jason at gcc dot gnu dot org
@ 2008-02-22 17:51 ` pinskia at gcc dot gnu dot org
  2008-02-22 18:04 ` jason at gcc dot gnu dot org
  20 siblings, 0 replies; 22+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-02-22 17:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #18 from pinskia at gcc dot gnu dot org  2008-02-22 17:50 -------
g++.dg/other/anon5.C fails on i386-darwin:
/var/tmp//ccpes1Oj.s:20:non-relocatable subtraction expression,
"__ZN12_GLOBAL__N_11c1tE" minus "L00000000001$pb"^M
/var/tmp//ccpes1Oj.s:20:symbol: "__ZN12_GLOBAL__N_11c1tE" can't be undefined in
a subtraction expression^M
compiler exited with status 1
output is:
/var/tmp//ccpes1Oj.s:20:non-relocatable subtraction expression,
"__ZN12_GLOBAL__N_11c1tE" minus "L00000000001$pb"^M
/var/tmp//ccpes1Oj.s:20:symbol: "__ZN12_GLOBAL__N_11c1tE" can't be undefined in
a subtraction expression^M


-- 


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


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

* [Bug c++/34094] [4.2/4.3 Regression] Undefined static data member in anonymous namespace can acquire a definition anyway
  2007-11-14 18:43 [Bug c++/34094] New: Undefined static data member can acquire a definition anyway simon_baldwin at yahoo dot com
                   ` (19 preceding siblings ...)
  2008-02-22 17:51 ` pinskia at gcc dot gnu dot org
@ 2008-02-22 18:04 ` jason at gcc dot gnu dot org
  20 siblings, 0 replies; 22+ messages in thread
From: jason at gcc dot gnu dot org @ 2008-02-22 18:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #19 from jason at gcc dot gnu dot org  2008-02-22 18:03 -------
Seems Darwin doesn't track the source position of undefined symbol references. 
Feel free to improve the testcase.


-- 


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


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

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

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-14 18:43 [Bug c++/34094] New: Undefined static data member can acquire a definition anyway simon_baldwin at yahoo dot com
2007-11-14 19:21 ` [Bug c++/34094] Undefined static data member in anonymous namespace " pinskia at gcc dot gnu dot org
2007-11-15  4:40 ` bangerth at dealii dot org
2007-11-15 19:56 ` simon_baldwin at yahoo dot com
2007-11-19  5:22 ` [Bug c++/34094] [4.2/4.3 Regression] " pinskia at gcc dot gnu dot org
2007-11-20 18:01 ` jakub at gcc dot gnu dot org
2007-11-22 14:06 ` jakub at gcc dot gnu dot org
2007-11-22 14:07 ` [Bug c++/34094] [4.2 " jakub at gcc dot gnu dot org
2007-11-25 20:46 ` pinskia at gcc dot gnu dot org
2007-12-11  8:42 ` jakub at gcc dot gnu dot org
2007-12-11  8:48 ` jakub at gcc dot gnu dot org
2007-12-11  8:49 ` [Bug c++/34094] [4.2/4.3 " jakub at gcc dot gnu dot org
2007-12-12 20:57 ` mmitchel at gcc dot gnu dot org
2007-12-18 23:47 ` crowl at google dot com
2007-12-18 23:52 ` pinskia at gcc dot gnu dot org
2008-02-01 17:02 ` jsm28 at gcc dot gnu dot org
2008-02-10 16:34 ` jason at gcc dot gnu dot org
2008-02-10 18:13 ` jason at gcc dot gnu dot org
2008-02-12  6:39 ` jason at gcc dot gnu dot org
2008-02-12  6:42 ` jason at gcc dot gnu dot org
2008-02-22 17:51 ` pinskia at gcc dot gnu dot org
2008-02-22 18:04 ` 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).