public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/7524: "f(const float arg[3])" fails
@ 2002-08-07  8:56 braden
  0 siblings, 0 replies; 3+ messages in thread
From: braden @ 2002-08-07  8:56 UTC (permalink / raw)
  To: gcc-gnats


>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()
{}


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: c++/7524: "f(const float arg[3])" fails
@ 2002-10-16 10:44 mmitchel
  0 siblings, 0 replies; 3+ messages in thread
From: mmitchel @ 2002-10-16 10:44 UTC (permalink / raw)
  To: braden, gcc-bugs, gcc-prs, mmitchel, nobody

Synopsis: "f(const float arg[3])" fails

Responsible-Changed-From-To: unassigned->mmitchel
Responsible-Changed-By: mmitchel
Responsible-Changed-When: Wed Oct 16 10:44:26 2002
Responsible-Changed-Why:
    Working on a fix.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7524


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: c++/7524: "f(const float arg[3])" fails
@ 2002-09-13 16:18 nathan
  0 siblings, 0 replies; 3+ messages in thread
From: nathan @ 2002-09-13 16:18 UTC (permalink / raw)
  To: braden, gcc-bugs, gcc-prs, nobody

Synopsis: "f(const float arg[3])" fails

State-Changed-From-To: open->analyzed
State-Changed-By: nathan
State-Changed-When: Fri Sep 13 16:18:08 2002
State-Changed-Why:
    confirmed

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7524


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-10-16 17:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-07  8:56 c++/7524: "f(const float arg[3])" fails braden
2002-09-13 16:18 nathan
2002-10-16 10:44 mmitchel

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).