public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/22452] New: [4.1 regression] ICE expected tree that contains 'decl with visibility' structure, have 'const_decl'  in decl_linkage, at cp/tree.c:2132
@ 2005-07-13  8:15 belyshev at depni dot sinp dot msu dot ru
  2005-07-13  9:39 ` [Bug c++/22452] " reichelt at gcc dot gnu dot org
                   ` (12 more replies)
  0 siblings, 13 replies; 16+ messages in thread
From: belyshev at depni dot sinp dot msu dot ru @ 2005-07-13  8:15 UTC (permalink / raw)
  To: gcc-bugs

// C++ testcase, compile with -O0

extern "C" {
  struct T {
    enum { E };
  };
}

bug.ii:5: internal compiler error: tree check: expected tree that contains 'decl
with visibility' structure, have 'const_decl'  in decl_linkage, at cp/tree.c:2132

-- 
           Summary: [4.1 regression] ICE expected tree that contains 'decl
                    with visibility' structure, have 'const_decl'  in
                    decl_linkage, at cp/tree.c:2132
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code, ice-checking
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: belyshev at depni dot sinp dot msu dot ru
                CC: dberlin at gcc dot gnu dot org,gcc-bugs at gcc dot gnu
                    dot org


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


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

* [Bug c++/22452] [4.1 regression] ICE expected tree that contains 'decl with visibility' structure, have 'const_decl'  in decl_linkage, at cp/tree.c:2132
  2005-07-13  8:15 [Bug c++/22452] New: [4.1 regression] ICE expected tree that contains 'decl with visibility' structure, have 'const_decl' in decl_linkage, at cp/tree.c:2132 belyshev at depni dot sinp dot msu dot ru
@ 2005-07-13  9:39 ` reichelt at gcc dot gnu dot org
  2005-07-13 11:35 ` pinskia at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2005-07-13  9:39 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From reichelt at gcc dot gnu dot org  2005-07-13 08:34 -------
Confirmed.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |reichelt at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |monitored
   Last reconfirmed|0000-00-00 00:00:00         |2005-07-13 08:34:41
               date|                            |
   Target Milestone|---                         |4.1.0


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


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

* [Bug c++/22452] [4.1 regression] ICE expected tree that contains 'decl with visibility' structure, have 'const_decl'  in decl_linkage, at cp/tree.c:2132
  2005-07-13  8:15 [Bug c++/22452] New: [4.1 regression] ICE expected tree that contains 'decl with visibility' structure, have 'const_decl' in decl_linkage, at cp/tree.c:2132 belyshev at depni dot sinp dot msu dot ru
  2005-07-13  9:39 ` [Bug c++/22452] " reichelt at gcc dot gnu dot org
@ 2005-07-13 11:35 ` pinskia at gcc dot gnu dot org
  2005-07-13 12:38 ` dberlin at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-13 11:35 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-07-13 11:33 -------
CONST_DECL don't have linkage at all.
DECL_COMDAT is the problem.

-- 


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


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

* [Bug c++/22452] [4.1 regression] ICE expected tree that contains 'decl with visibility' structure, have 'const_decl'  in decl_linkage, at cp/tree.c:2132
  2005-07-13  8:15 [Bug c++/22452] New: [4.1 regression] ICE expected tree that contains 'decl with visibility' structure, have 'const_decl' in decl_linkage, at cp/tree.c:2132 belyshev at depni dot sinp dot msu dot ru
  2005-07-13  9:39 ` [Bug c++/22452] " reichelt at gcc dot gnu dot org
  2005-07-13 11:35 ` pinskia at gcc dot gnu dot org
@ 2005-07-13 12:38 ` dberlin at gcc dot gnu dot org
  2005-07-14 13:52 ` dberlin at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: dberlin at gcc dot gnu dot org @ 2005-07-13 12:38 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dberlin at gcc dot gnu dot org  2005-07-13 12:38 -------
What is the proper linkage for an enum?


-- 


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


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

* [Bug c++/22452] [4.1 regression] ICE expected tree that contains 'decl with visibility' structure, have 'const_decl'  in decl_linkage, at cp/tree.c:2132
  2005-07-13  8:15 [Bug c++/22452] New: [4.1 regression] ICE expected tree that contains 'decl with visibility' structure, have 'const_decl' in decl_linkage, at cp/tree.c:2132 belyshev at depni dot sinp dot msu dot ru
                   ` (2 preceding siblings ...)
  2005-07-13 12:38 ` dberlin at gcc dot gnu dot org
@ 2005-07-14 13:52 ` dberlin at gcc dot gnu dot org
  2005-07-14 15:14   ` Gabriel Dos Reis
  2005-07-14 15:17 ` gdr at integrable-solutions dot net
                   ` (8 subsequent siblings)
  12 siblings, 1 reply; 16+ messages in thread
From: dberlin at gcc dot gnu dot org @ 2005-07-14 13:52 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dberlin at gcc dot gnu dot org  2005-07-14 13:49 -------
Nathan tells me it's lk_internal for a CONST_DECL.
fixing.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |dberlin at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2005-07-13 08:34:41         |2005-07-14 13:49:07
               date|                            |


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


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

* Re: [Bug c++/22452] [4.1 regression] ICE expected tree that contains 'decl with visibility' structure, have 'const_decl'  in decl_linkage, at cp/tree.c:2132
  2005-07-14 13:52 ` dberlin at gcc dot gnu dot org
@ 2005-07-14 15:14   ` Gabriel Dos Reis
  0 siblings, 0 replies; 16+ messages in thread
From: Gabriel Dos Reis @ 2005-07-14 15:14 UTC (permalink / raw)
  To: gcc-bugzilla; +Cc: gcc-bugs

"dberlin at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:

| Nathan tells me it's lk_internal for a CONST_DECL.

Where does that come from?

There is a section numbered 3.5 and titled "Program and linkage".  It
says in paragraph 4

  A name having namespace scope has external linkage if it is the name of
  -- an object or reference, unless it has internal linkage; or

  -- a function, unless it has internal linkage; or

  -- a named class (clause 9), or an unnamed class defined in a
     typedef declaration in which the class has the typedef name for
     linkage purposes (7.1.3); or 

  -- a named enumeration (7.2), or an unnamed enumeration defined in a
     typedef declaration in which the enumeration has the typedef name
      for linkage purposes (7.1.3); or 

  -- an enumerator belonging to an enumeration with external linkage; or

  -- a template, unless it is a function template that has internal
     linkage (clause 14); or

  -- a namespace (7.3), unless it is declared within an unnamed namespace.

And in paragraph 8, it continues:

  Names not covered by these rules have no linkage. Moreover, except
  as noted, a name declared in a local scope (3.3.2) has no linkage. A
  name with no linkage (notably, the name of a class or enumeration
  declared in a local scope (3.3.2)) shall not be used to declare an
  entity with linkage. If a declaration uses a typedef name, it is the
  linkage of the type name to which the typedef refers that is considered.

those clearly indicates to me that the linkage of a CONST_DECL
depends on the linkage of its enumeration.

| fixing.

Please look at section 3.5 before fixing this.  
(besides an numeration does not have storage).

-- Gaby


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

* [Bug c++/22452] [4.1 regression] ICE expected tree that contains 'decl with visibility' structure, have 'const_decl'  in decl_linkage, at cp/tree.c:2132
  2005-07-13  8:15 [Bug c++/22452] New: [4.1 regression] ICE expected tree that contains 'decl with visibility' structure, have 'const_decl' in decl_linkage, at cp/tree.c:2132 belyshev at depni dot sinp dot msu dot ru
                   ` (3 preceding siblings ...)
  2005-07-14 13:52 ` dberlin at gcc dot gnu dot org
@ 2005-07-14 15:17 ` gdr at integrable-solutions dot net
  2005-07-14 16:04 ` dberlin at dberlin dot org
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: gdr at integrable-solutions dot net @ 2005-07-14 15:17 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gdr at integrable-solutions dot net  2005-07-14 15:14 -------
Subject: Re:  [4.1 regression] ICE expected tree that contains 'decl with visibility' structure, have 'const_decl'  in decl_linkage, at cp/tree.c:2132

"dberlin at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:

| Nathan tells me it's lk_internal for a CONST_DECL.

Where does that come from?

There is a section numbered 3.5 and titled "Program and linkage".  It
says in paragraph 4

  A name having namespace scope has external linkage if it is the name of
  -- an object or reference, unless it has internal linkage; or

  -- a function, unless it has internal linkage; or

  -- a named class (clause 9), or an unnamed class defined in a
     typedef declaration in which the class has the typedef name for
     linkage purposes (7.1.3); or 

  -- a named enumeration (7.2), or an unnamed enumeration defined in a
     typedef declaration in which the enumeration has the typedef name
      for linkage purposes (7.1.3); or 

  -- an enumerator belonging to an enumeration with external linkage; or

  -- a template, unless it is a function template that has internal
     linkage (clause 14); or

  -- a namespace (7.3), unless it is declared within an unnamed namespace.

And in paragraph 8, it continues:

  Names not covered by these rules have no linkage. Moreover, except
  as noted, a name declared in a local scope (3.3.2) has no linkage. A
  name with no linkage (notably, the name of a class or enumeration
  declared in a local scope (3.3.2)) shall not be used to declare an
  entity with linkage. If a declaration uses a typedef name, it is the
  linkage of the type name to which the typedef refers that is considered.

those clearly indicates to me that the linkage of a CONST_DECL
depends on the linkage of its enumeration.

| fixing.

Please look at section 3.5 before fixing this.  
(besides an numeration does not have storage).

-- Gaby


-- 


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


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

* [Bug c++/22452] [4.1 regression] ICE expected tree that contains 'decl with visibility' structure, have 'const_decl'  in decl_linkage, at cp/tree.c:2132
  2005-07-13  8:15 [Bug c++/22452] New: [4.1 regression] ICE expected tree that contains 'decl with visibility' structure, have 'const_decl' in decl_linkage, at cp/tree.c:2132 belyshev at depni dot sinp dot msu dot ru
                   ` (4 preceding siblings ...)
  2005-07-14 15:17 ` gdr at integrable-solutions dot net
@ 2005-07-14 16:04 ` dberlin at dberlin dot org
  2005-07-14 19:38 ` gdr at integrable-solutions dot net
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: dberlin at dberlin dot org @ 2005-07-14 16:04 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dberlin at gcc dot gnu dot org  2005-07-14 16:03 -------
Subject: Re:  [4.1 regression] ICE expected tree that
	contains 'decl with visibility' structure, have 'const_decl'  in
	decl_linkage, at cp/tree.c:2132


> | fixing.
> 
> Please look at section 3.5 before fixing this.  
> (besides an numeration does not have storage).
> 
I am not a C++ expert.   I can't read the C++ standard well.

I simply told him what cp-tree.h said about linkage (please read it),
and asked him what an *enumeration value* (not type) has in terms of
linkage.

I know for a *fact* that it used to return lk_internal in this testcase.

If you want to disagree about how to fix it, please simply look at
decl_linkage and tell me what i am supposed to be returning for a
CONST_DECL.

I really don't have the skills to play language lawyer here, my
inclination is to just make it do what it used to, which is return
lk_internal.

--Dan



-- 


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


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

* [Bug c++/22452] [4.1 regression] ICE expected tree that contains 'decl with visibility' structure, have 'const_decl'  in decl_linkage, at cp/tree.c:2132
  2005-07-13  8:15 [Bug c++/22452] New: [4.1 regression] ICE expected tree that contains 'decl with visibility' structure, have 'const_decl' in decl_linkage, at cp/tree.c:2132 belyshev at depni dot sinp dot msu dot ru
                   ` (5 preceding siblings ...)
  2005-07-14 16:04 ` dberlin at dberlin dot org
@ 2005-07-14 19:38 ` gdr at integrable-solutions dot net
  2005-07-14 20:40 ` dberlin at dberlin dot org
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: gdr at integrable-solutions dot net @ 2005-07-14 19:38 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gdr at integrable-solutions dot net  2005-07-14 19:36 -------
Subject: Re:  [4.1 regression] ICE expected tree that contains 'decl with visibility' structure, have 'const_decl'  in decl_linkage, at cp/tree.c:2132

"dberlin at dberlin dot org" <gcc-bugzilla@gcc.gnu.org> writes:

| ------- Additional Comments From dberlin at gcc dot gnu dot org  2005-07-14 16:03 -------
| Subject: Re:  [4.1 regression] ICE expected tree that
| 	contains 'decl with visibility' structure, have 'const_decl'  in
| 	decl_linkage, at cp/tree.c:2132
| 
| 
| > | fixing.
| > 
| > Please look at section 3.5 before fixing this.  
| > (besides an numeration does not have storage).
| > 
| I am not a C++ expert.   I can't read the C++ standard well.
| 
| I simply told him what cp-tree.h said about linkage (please read it),
| and asked him what an *enumeration value* (not type) has in terms of
| linkage.


In C++:

   * an enumration is the type.
   * An enumerator is the named value

and the quote I providfed addresses explicitly the case of enumerator
(the subject of this Pr): Its linkage depends on that of its
enumeration (the type)

| I know for a *fact* that it used to return lk_internal in this testcase.

The point is that that is wrong, at least if the notion of linkage has
any relation with what C++ standard says.

(CONST_DECLs do not occupy storage; the notion of linkage has to do
with names ans uses within and across translation units).

| If you want to disagree about how to fix it, please simply look at
| decl_linkage and tell me what i am supposed to be returning for a
| CONST_DECL.

The linkage for CONST_DECL should be lk_external is its type has
lk_external linkage; it should be lk_none if its type is local,
otherwise if its type has lk_internal then it is lk_internal.

For example, in 

    namespace foo {
       enum color { red, green, blue };
    }

foo::color, foo::green and foo::bleu all have external linkage.

| 
| I really don't have the skills to play language lawyer here, my

I'm not here to play language lawyer neither; but the claim just looks
wrong to me.  Unless you define playing language lawyer as giving
asnwer you questions you raised.

| inclination is to just make it do what it used to, which is return
| lk_internal.

Then you have to test whether you can use the reulsint CONST_DECL as
template argument for example.


-- 


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


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

* [Bug c++/22452] [4.1 regression] ICE expected tree that contains 'decl with visibility' structure, have 'const_decl'  in decl_linkage, at cp/tree.c:2132
  2005-07-13  8:15 [Bug c++/22452] New: [4.1 regression] ICE expected tree that contains 'decl with visibility' structure, have 'const_decl' in decl_linkage, at cp/tree.c:2132 belyshev at depni dot sinp dot msu dot ru
                   ` (6 preceding siblings ...)
  2005-07-14 19:38 ` gdr at integrable-solutions dot net
@ 2005-07-14 20:40 ` dberlin at dberlin dot org
  2005-07-14 20:41 ` dberlin at dberlin dot org
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: dberlin at dberlin dot org @ 2005-07-14 20:40 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dberlin at gcc dot gnu dot org  2005-07-14 20:36 -------
Subject: Re:  [4.1 regression] ICE expected tree that
	contains 'decl with visibility' structure, have 'const_decl'  in
	decl_linkage, at cp/tree.c:2132


> The point is that that is wrong, at least if the notion of linkage has
> any relation with what C++ standard says.

Please come up with a testcase that demonstrates it getting the wrong
answer with the old result, or i'm simply going to do that.




-- 


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


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

* [Bug c++/22452] [4.1 regression] ICE expected tree that contains 'decl with visibility' structure, have 'const_decl'  in decl_linkage, at cp/tree.c:2132
  2005-07-13  8:15 [Bug c++/22452] New: [4.1 regression] ICE expected tree that contains 'decl with visibility' structure, have 'const_decl' in decl_linkage, at cp/tree.c:2132 belyshev at depni dot sinp dot msu dot ru
                   ` (7 preceding siblings ...)
  2005-07-14 20:40 ` dberlin at dberlin dot org
@ 2005-07-14 20:41 ` dberlin at dberlin dot org
  2005-07-14 21:18   ` Gabriel Dos Reis
  2005-07-14 21:07 ` gdr at integrable-solutions dot net
                   ` (3 subsequent siblings)
  12 siblings, 1 reply; 16+ messages in thread
From: dberlin at dberlin dot org @ 2005-07-14 20:41 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dberlin at gcc dot gnu dot org  2005-07-14 20:40 -------
Subject: Re:  [4.1 regression] ICE expected tree that
	contains 'decl with visibility' structure, have 'const_decl'  in
	decl_linkage, at cp/tree.c:2132


> | 
> | I really don't have the skills to play language lawyer here, my
> 
> I'm not here to play language lawyer neither; but the claim just looks
> wrong to me.  Unless you define playing language lawyer as giving
> asnwer you questions you raised.
Playing language lawyer is sitting here quoting the standard at me
instead of demonstrating a testcase where the old answer is wrong.





-- 


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


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

* [Bug c++/22452] [4.1 regression] ICE expected tree that contains 'decl with visibility' structure, have 'const_decl'  in decl_linkage, at cp/tree.c:2132
  2005-07-13  8:15 [Bug c++/22452] New: [4.1 regression] ICE expected tree that contains 'decl with visibility' structure, have 'const_decl' in decl_linkage, at cp/tree.c:2132 belyshev at depni dot sinp dot msu dot ru
                   ` (8 preceding siblings ...)
  2005-07-14 20:41 ` dberlin at dberlin dot org
@ 2005-07-14 21:07 ` gdr at integrable-solutions dot net
  2005-07-14 21:20 ` gdr at integrable-solutions dot net
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: gdr at integrable-solutions dot net @ 2005-07-14 21:07 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gdr at integrable-solutions dot net  2005-07-14 20:53 -------
Subject: Re:  [4.1 regression] ICE expected tree that contains 'decl with visibility' structure, have 'const_decl'  in decl_linkage, at cp/tree.c:2132

"dberlin at dberlin dot org" <gcc-bugzilla@gcc.gnu.org> writes:

| ------- Additional Comments From dberlin at gcc dot gnu dot org  2005-07-14 20:36 -------
| Subject: Re:  [4.1 regression] ICE expected tree that
| 	contains 'decl with visibility' structure, have 'const_decl'  in
| 	decl_linkage, at cp/tree.c:2132
| 
| 
| > The point is that that is wrong, at least if the notion of linkage has
| > any relation with what C++ standard says.
| 
| Please come up with a testcase that demonstrates it getting the wrong
| answer with the old result, or i'm simply going to do that.

come up with your patch and we will see, since you obviously prefer
to insult  people when they are trying to help you.

-- Gaby


-- 


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


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

* Re: [Bug c++/22452] [4.1 regression] ICE expected tree that contains 'decl with visibility' structure, have 'const_decl'  in decl_linkage, at cp/tree.c:2132
  2005-07-14 20:41 ` dberlin at dberlin dot org
@ 2005-07-14 21:18   ` Gabriel Dos Reis
  0 siblings, 0 replies; 16+ messages in thread
From: Gabriel Dos Reis @ 2005-07-14 21:18 UTC (permalink / raw)
  To: gcc-bugzilla; +Cc: gcc-bugs

"dberlin at dberlin dot org" <gcc-bugzilla@gcc.gnu.org> writes:

| ------- Additional Comments From dberlin at gcc dot gnu dot org  2005-07-14 20:40 -------
| Subject: Re:  [4.1 regression] ICE expected tree that
| 	contains 'decl with visibility' structure, have 'const_decl'  in
| 	decl_linkage, at cp/tree.c:2132
| 
| 
| > | 
| > | I really don't have the skills to play language lawyer here, my
| > 
| > I'm not here to play language lawyer neither; but the claim just looks
| > wrong to me.  Unless you define playing language lawyer as giving
| > asnwer you questions you raised.
| Playing language lawyer is sitting here quoting the standard at me
| instead of demonstrating a testcase where the old answer is wrong.

The comment in front of DECL_EXTERNAL_LINKAGE_P says this:

   /* Returns nonzero if DECL has external linkage, as specified by the
      language standard.  (This predicate may hold even when the
      corresponding entity is not actually given external linkage in the
      object file; see decl_linkage for details.)  */
   #define DECL_EXTERNAL_LINKAGE_P(DECL) \
     (decl_linkage (DECL) == lk_external)

So, if you find a testcase where decl_linkage() returns lk_internal
insteand of lk_external, then you have found a bug in the compiler.
The fix is not to copy-and-paste that error.  Language lawyering
notwithstanding. 

-- Gaby


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

* [Bug c++/22452] [4.1 regression] ICE expected tree that contains 'decl with visibility' structure, have 'const_decl'  in decl_linkage, at cp/tree.c:2132
  2005-07-13  8:15 [Bug c++/22452] New: [4.1 regression] ICE expected tree that contains 'decl with visibility' structure, have 'const_decl' in decl_linkage, at cp/tree.c:2132 belyshev at depni dot sinp dot msu dot ru
                   ` (9 preceding siblings ...)
  2005-07-14 21:07 ` gdr at integrable-solutions dot net
@ 2005-07-14 21:20 ` gdr at integrable-solutions dot net
  2005-07-15 20:24 ` cvs-commit at gcc dot gnu dot org
  2005-07-15 20:47 ` pinskia at gcc dot gnu dot org
  12 siblings, 0 replies; 16+ messages in thread
From: gdr at integrable-solutions dot net @ 2005-07-14 21:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gdr at integrable-solutions dot net  2005-07-14 21:17 -------
Subject: Re:  [4.1 regression] ICE expected tree that contains 'decl with visibility' structure, have 'const_decl'  in decl_linkage, at cp/tree.c:2132

"dberlin at dberlin dot org" <gcc-bugzilla@gcc.gnu.org> writes:

| ------- Additional Comments From dberlin at gcc dot gnu dot org  2005-07-14 20:40 -------
| Subject: Re:  [4.1 regression] ICE expected tree that
| 	contains 'decl with visibility' structure, have 'const_decl'  in
| 	decl_linkage, at cp/tree.c:2132
| 
| 
| > | 
| > | I really don't have the skills to play language lawyer here, my
| > 
| > I'm not here to play language lawyer neither; but the claim just looks
| > wrong to me.  Unless you define playing language lawyer as giving
| > asnwer you questions you raised.
| Playing language lawyer is sitting here quoting the standard at me
| instead of demonstrating a testcase where the old answer is wrong.

The comment in front of DECL_EXTERNAL_LINKAGE_P says this:

   /* Returns nonzero if DECL has external linkage, as specified by the
      language standard.  (This predicate may hold even when the
      corresponding entity is not actually given external linkage in the
      object file; see decl_linkage for details.)  */
   #define DECL_EXTERNAL_LINKAGE_P(DECL) \
     (decl_linkage (DECL) == lk_external)

So, if you find a testcase where decl_linkage() returns lk_internal
insteand of lk_external, then you have found a bug in the compiler.
The fix is not to copy-and-paste that error.  Language lawyering
notwithstanding. 

-- Gaby


-- 


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


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

* [Bug c++/22452] [4.1 regression] ICE expected tree that contains 'decl with visibility' structure, have 'const_decl'  in decl_linkage, at cp/tree.c:2132
  2005-07-13  8:15 [Bug c++/22452] New: [4.1 regression] ICE expected tree that contains 'decl with visibility' structure, have 'const_decl' in decl_linkage, at cp/tree.c:2132 belyshev at depni dot sinp dot msu dot ru
                   ` (10 preceding siblings ...)
  2005-07-14 21:20 ` gdr at integrable-solutions dot net
@ 2005-07-15 20:24 ` cvs-commit at gcc dot gnu dot org
  2005-07-15 20:47 ` pinskia at gcc dot gnu dot org
  12 siblings, 0 replies; 16+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-07-15 20:24 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-07-15 20:22 -------
Subject: Bug 22452

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	dberlin@gcc.gnu.org	2005-07-15 20:22:40

Modified files:
	gcc/cp         : ChangeLog tree.c 

Log message:
	2005-07-14  Daniel Berlin  <dberlin@dberlin.org>
	
	Fix PR c++/22452
	* tree.c (decl_linkage): Don't check DECL_COMDAT on CONST_DECL.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4820&r2=1.4821
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/tree.c.diff?cvsroot=gcc&r1=1.439&r2=1.440



-- 


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


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

* [Bug c++/22452] [4.1 regression] ICE expected tree that contains 'decl with visibility' structure, have 'const_decl'  in decl_linkage, at cp/tree.c:2132
  2005-07-13  8:15 [Bug c++/22452] New: [4.1 regression] ICE expected tree that contains 'decl with visibility' structure, have 'const_decl' in decl_linkage, at cp/tree.c:2132 belyshev at depni dot sinp dot msu dot ru
                   ` (11 preceding siblings ...)
  2005-07-15 20:24 ` cvs-commit at gcc dot gnu dot org
@ 2005-07-15 20:47 ` pinskia at gcc dot gnu dot org
  12 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-15 20:47 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-07-15 20:45 -------
Fixed.

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


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


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

end of thread, other threads:[~2005-07-15 20:45 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-13  8:15 [Bug c++/22452] New: [4.1 regression] ICE expected tree that contains 'decl with visibility' structure, have 'const_decl' in decl_linkage, at cp/tree.c:2132 belyshev at depni dot sinp dot msu dot ru
2005-07-13  9:39 ` [Bug c++/22452] " reichelt at gcc dot gnu dot org
2005-07-13 11:35 ` pinskia at gcc dot gnu dot org
2005-07-13 12:38 ` dberlin at gcc dot gnu dot org
2005-07-14 13:52 ` dberlin at gcc dot gnu dot org
2005-07-14 15:14   ` Gabriel Dos Reis
2005-07-14 15:17 ` gdr at integrable-solutions dot net
2005-07-14 16:04 ` dberlin at dberlin dot org
2005-07-14 19:38 ` gdr at integrable-solutions dot net
2005-07-14 20:40 ` dberlin at dberlin dot org
2005-07-14 20:41 ` dberlin at dberlin dot org
2005-07-14 21:18   ` Gabriel Dos Reis
2005-07-14 21:07 ` gdr at integrable-solutions dot net
2005-07-14 21:20 ` gdr at integrable-solutions dot net
2005-07-15 20:24 ` cvs-commit at gcc dot gnu dot org
2005-07-15 20:47 ` pinskia 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).