------- 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" <[EMAIL PROTECTED]> 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