c++/10468: Type interpreted as int& instead of const int&

Mark Goodman mgoodman@CSUA.Berkeley.EDU
Wed Apr 30 12:16:00 GMT 2003


bangerth@dealii.org wrote:

>Synopsis: Type interpreted as int& instead of const int&
>
>State-Changed-From-To: open->feedback
>State-Changed-By: bangerth
>State-Changed-When: Wed Apr 23 21:47:56 2003
>State-Changed-Why:
>    Why should it be different than what gcc does? Can you
>    point to a certain paragraph in the standard? I'd think
>    gcc is right.
>    
>    Wolfgang
>
>http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10468
>
const typeof(x) t1& should be const int & not int & when x is an int.  
AFAIK, typeof is a gcc extension so no I can't point to a certain 
paragraph in the ISO C++ standard.  If the template declaration is 
removed and T is changed to an int, the code works just fine.  I think 
gcc is broken in this particular case.  I have looked at finish_typeof 
in gcc/cp/semantics.c but I don't see how to dump the tree  from there.

Mark




More information about the Gcc-bugs mailing list