public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: braden@endoframe.com To: gcc-gnats@gcc.gnu.org Subject: c++/7524: "f(const float arg[3])" fails Date: Wed, 07 Aug 2002 08:56:00 -0000 [thread overview] Message-ID: <20020807153639.10826.qmail@sources.redhat.com> (raw) >Number: 7524 >Category: c++ >Synopsis: "f(const float arg[3])" fails >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: rejects-legal >Submitter-Id: net >Arrival-Date: Wed Aug 07 08:46:02 PDT 2002 >Closed-Date: >Last-Modified: >Originator: braden@endoframe.com >Release: 3.1.1 >Organization: >Environment: >Description: In the attached demonstration case, g++ is having problems with function argument declarations of the form f(const float arg[3]); Peculiarly, g++ is able to compile the code if the "assign" method in the example is removed. >How-To-Repeat: See attached test case. >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: text/plain; name="test.cc" Content-Disposition: inline; filename="test.cc" # include <string> # include <typeinfo> # include <vector> class FieldValue { public: virtual ~FieldValue() throw () = 0; virtual FieldValue & assign(const FieldValue & value) throw (std::bad_cast, std::bad_alloc) = 0; }; class SFColor : public FieldValue { float d_rgb[3]; public: static void HSVtoRGB(const float hsv[3], float rgb[3]) throw (); static void RGBtoHSV(const float rgb[3], float hsv[3]) throw (); SFColor() throw (); virtual ~SFColor() throw (); // Use compiler-defined copy ctor and operator=. void set(const float rgb[3]) throw (); virtual FieldValue & assign(const FieldValue & value) throw (std::bad_cast); }; FieldValue::~FieldValue() throw () {} SFColor::SFColor() throw () { this->d_rgb[0] = 0.0f; this->d_rgb[1] = 0.0f; this->d_rgb[2] = 0.0f; } SFColor::~SFColor() throw () {} FieldValue & SFColor::assign(const FieldValue & value) throw (std::bad_cast) { return (*this = dynamic_cast<const SFColor &>(value)); } void SFColor::set(const float rgb[3]) throw () { this->d_rgb[0] = rgb[0]; this->d_rgb[1] = rgb[1]; this->d_rgb[2] = rgb[2]; } void SFColor::HSVtoRGB(const float hsv[3], float rgb[3]) throw () {} void SFColor::RGBtoHSV(const float rgb[3], float hsv[3]) throw () {} int main() {}
next reply other threads:[~2002-08-07 15:46 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2002-08-07 8:56 braden [this message] 2002-09-13 16:18 nathan 2002-10-16 10:44 mmitchel
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20020807153639.10826.qmail@sources.redhat.com \ --to=braden@endoframe.com \ --cc=gcc-gnats@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).