Article View: gnu.g++.bug
Article #127Incorrect 'conversion to reference of read-only variable' error
From: Jason Merrill
Date: Fri, 03 Apr 1992 09:23
Date: Fri, 03 Apr 1992 09:23
25 lines
844 bytes
844 bytes
This code:
class Object {
...
static Object* const nil;
...
}
...
Object*& Arraychar::at(int)
{
shouldNotImplement("at");
return (Object*&)nil;
}
produces the error
Arraychar.c:291: conversion to reference of read-only variable `nil'
Here g++ should quietly cast away nil's const-ness.
--
Jason Merrill
jason@jarthur.claremont.edu
Technical Details
Message-ID:
<1992Apr3.092315.28243@muddcs.claremont.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!think.com!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!jarthur.claremont.edu!jasonShow Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug Path: arc1-ca.pugleaf.net!sparky!uunet!think.com!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!jarthur.claremont.edu!jason From: jason@jarthur.claremont.edu (Jason Merrill) Subject: Incorrect 'conversion to reference of read-only variable' error Message-ID: <1992Apr3.092315.28243@muddcs.claremont.edu> Sender: gnulists@ai.mit.edu Organization: Harvey Mudd College Distribution: gnu Date: Fri, 3 Apr 1992 09:23:15 GMT Approved: bug-g++@prep.ai.mit.edu Lines: 26