[Bug c++/31187] [4.2/4.3 regression] extern declaration of variable in anonymous namespace prevents use of its address as template argument
--- Comment #10 from jakub at gcc dot gnu dot org 2007-06-26 11:57 --- Subject: Bug 31187 Author: jakub Date: Tue Jun 26 11:57:42 2007 New Revision: 126027 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=126027 Log: 2007-03-30 Jason Merrill [EMAIL PROTECTED] PR c++/31187 * typeck.c (cp_type_readonly): New fn. * cp-tree.h: Declare it. * decl.c (start_decl): Set implicit DECL_THIS_STATIC here. (cp_finish_decl): Not here. 2007-04-02 Jason Merrill [EMAIL PROTECTED] PR c++/31187 * g++.dg/ext/visibility/anon3.C: New test. Added: branches/redhat/gcc-4_1-branch/gcc/testsuite/g++.dg/ext/visibility/anon3.C Modified: branches/redhat/gcc-4_1-branch/gcc/cp/ChangeLog branches/redhat/gcc-4_1-branch/gcc/cp/cp-tree.h branches/redhat/gcc-4_1-branch/gcc/cp/decl.c branches/redhat/gcc-4_1-branch/gcc/cp/typeck.c branches/redhat/gcc-4_1-branch/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31187
[Bug c++/31187] [4.2/4.3 regression] extern declaration of variable in anonymous namespace prevents use of its address as template argument
--- Comment #9 from jason at gcc dot gnu dot org 2007-04-09 22:43 --- Fixed in 4.2 branch and trunk. -- 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=31187
[Bug c++/31187] [4.2/4.3 regression] extern declaration of variable in anonymous namespace prevents use of its address as template argument
--- Comment #7 from jason at gcc dot gnu dot org 2007-04-02 18:49 --- Subject: Bug 31187 Author: jason Date: Mon Apr 2 18:49:21 2007 New Revision: 123432 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=123432 Log: PR c++/31187 * typeck.c (cp_type_readonly): New fn. * cp-tree.h: Declare it. * decl.c (start_decl): Set implicit DECL_THIS_STATIC here. (cp_finish_decl): Not here. * g++.dg/ext/visibility/anon3.C: New test. Added: trunk/gcc/testsuite/g++.dg/ext/visibility/anon3.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/cp-tree.h trunk/gcc/cp/decl.c trunk/gcc/cp/typeck.c trunk/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31187
[Bug c++/31187] [4.2/4.3 regression] extern declaration of variable in anonymous namespace prevents use of its address as template argument
--- Comment #8 from jason at gcc dot gnu dot org 2007-04-02 20:12 --- Subject: Bug 31187 Author: jason Date: Mon Apr 2 20:12:15 2007 New Revision: 123434 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=123434 Log: PR c++/31187 * typeck.c (cp_type_readonly): New fn. * cp-tree.h: Declare it. * decl.c (start_decl): Set implicit DECL_THIS_STATIC here. (cp_finish_decl): Not here. * g++.dg/ext/visibility/anon3.C: New test. Added: branches/gcc-4_2-branch/gcc/testsuite/g++.dg/ext/visibility/anon3.C - copied unchanged from r123432, trunk/gcc/testsuite/g++.dg/ext/visibility/anon3.C Modified: branches/gcc-4_2-branch/gcc/cp/ChangeLog branches/gcc-4_2-branch/gcc/cp/cp-tree.h branches/gcc-4_2-branch/gcc/cp/decl.c branches/gcc-4_2-branch/gcc/cp/typeck.c branches/gcc-4_2-branch/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31187
[Bug c++/31187] [4.2/4.3 regression] extern declaration of variable in anonymous namespace prevents use of its address as template argument
-- 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-03-15 16:07:38 |2007-03-27 03:37:29 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31187
[Bug c++/31187] [4.2/4.3 regression] extern declaration of variable in anonymous namespace prevents use of its address as template argument
-- mmitchel at gcc dot gnu dot org changed: What|Removed |Added Priority|P3 |P1 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31187
[Bug c++/31187] [4.2/4.3 regression] extern declaration of variable in anonymous namespace prevents use of its address as template argument
--- Comment #3 from mmitchel at gcc dot gnu dot org 2007-03-22 23:34 --- Jason -- This appears to be fallout from your patch for PR c++/28407 and/or c++/28409. Do you have time to take a look? Thanks, -- Mark -- mmitchel at gcc dot gnu dot org changed: What|Removed |Added CC||jason at redhat dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31187
[Bug c++/31187] [4.2/4.3 regression] extern declaration of variable in anonymous namespace prevents use of its address as template argument
--- Comment #4 from bangerth at dealii dot org 2007-03-23 02:37 --- Without wanting to be a distractor, but can variables of a type that was declared in an anonymous namespace really have external linkage? Think of the type being declared in a header file and one .cc file has the variable declaration/definition and another one an extern declaration for that variable. Do they refer to the same variable? I don't think so -- they have the same name, but distinct types, so we have an ODR violation. IMHO, variables with a type that comes from an anonymous namespace can but have internal linkage. 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=31187
[Bug c++/31187] [4.2/4.3 regression] extern declaration of variable in anonymous namespace prevents use of its address as template argument
--- Comment #5 from mark at codesourcery dot com 2007-03-23 02:44 --- Subject: Re: [4.2/4.3 regression] extern declaration of variable in anonymous namespace prevents use of its address as template argument bangerth at dealii dot org wrote: --- Comment #4 from bangerth at dealii dot org 2007-03-23 02:37 --- Without wanting to be a distractor, but can variables of a type that was declared in an anonymous namespace really have external linkage? That's not the case here; the class is in the global namespace. Only the variable is in the anonymous namespace, and entities in anonymous namespaces do have external linkage. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31187
[Bug c++/31187] [4.2/4.3 regression] extern declaration of variable in anonymous namespace prevents use of its address as template argument
--- Comment #6 from bangerth at dealii dot org 2007-03-23 03:03 --- (In reply to comment #5) That's not the case here; the class is in the global namespace. Oh, bummer, of course... -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31187
[Bug c++/31187] [4.2/4.3 regression] extern declaration of variable in anonymous namespace prevents use of its address as template argument
--- Comment #2 from gdr at cs dot tamu dot edu 2007-03-16 15:15 --- Subject: Re: New: [4.2 regression] extern declaration of variable in anonymous namespace prevents use of its address as template argument zak at transversal dot com [EMAIL PROTECTED] writes: | The following code, which compiles fine on gcc 4.1.2 and I believe is valid, | fails on an up-to-date checkout from the 4.2 branch: | | -- | class foo { }; | | namespace | { | extern foo foo1; | foo foo1; | } | | template foo * | class bar { }; | | bar foo1 bar1; | --- | | giving the error: | | test.cc:12: error: 'unnamed::foo1' is not a valid template argument of type | 'foo*' because 'unnamed::foo1' does not have external linkage | test.cc:12: error: invalid type in declaration before ';' token | | | ... which I would only expect if foo1 were declared static. Yes, this is a bug in the compiler. I suspect it was introduced when the the back was told to treat declarations at unnamed namespaces ast static. That of course is an optimization and should be appear at the front-end. -- gaby -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31187
[Bug c++/31187] [4.2/4.3 regression] extern declaration of variable in anonymous namespace prevents use of its address as template argument
-- pinskia at gcc dot gnu dot org changed: What|Removed |Added CC||pinskia at gcc dot gnu dot ||org, mmitchel at gcc dot gnu ||dot org Severity|normal |blocker GCC build triplet|x86_64-pc-linux-gnu | GCC host triplet|x86_64-pc-linux-gnu | Summary|[4.2 regression] extern |[4.2/4.3 regression] extern |declaration of variable in |declaration of variable in |anonymous namespace prevents|anonymous namespace prevents |use of its address as |use of its address as |template argument |template argument Target Milestone|--- |4.2.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31187
[Bug c++/31187] [4.2/4.3 regression] extern declaration of variable in anonymous namespace prevents use of its address as template argument
--- Comment #1 from pinskia at gcc dot gnu dot org 2007-03-15 16:07 --- Confirmed. -- pinskia at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2007-03-15 16:07:38 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31187