This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++] enumerators and check_initializer


Gabriel Dos Reis wrote:
> Hi,
> 
>   We have the following code in decl.c:check_initializer():
> 
> 
>   if (TREE_CODE (decl) == CONST_DECL)
>     {
>       gcc_assert (TREE_CODE (decl) != REFERENCE_TYPE);
> 
>       DECL_INITIAL (decl) = init;
> 
>       gcc_assert (init != NULL_TREE);
>       init = NULL_TREE;
>     }
> 
> 
> If decl is a CONST_DECL, then obviously the assert
> 
>       gcc_assert (TREE_CODE (decl) != REFERENCE_TYPE);
> 
> is trivially true.  Is it a typo for
> 
>       gcc_assert (TREE_CODE (TREE_TYPE (decl)) != REFERENCE_TYPE);
> 
> where one wanted to check that the decl is not a reference type?

Yes.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]