This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/6923: Ex of g++ 3.1 not compiling apparently valid code
- From: kent at iastate dot edu
- To: gcc-gnats at gcc dot gnu dot org
- Date: 3 Jun 2002 15:31:19 -0000
- Subject: c++/6923: Ex of g++ 3.1 not compiling apparently valid code
- Reply-to: kent at iastate dot edu
>Number: 6923
>Category: c++
>Synopsis: Ex of g++ 3.1 not compiling apparently valid code
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Jun 03 08:36:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Kent Vander Velden
>Release: 3.1
>Organization:
>Environment:
SunOS sun05 5.8 Generic_108528-13 sun4u sparc SUNW,Ultra-Enterprise
>Description:
The following code does not compile with g++ 3.1.
The error message is:
graph_viewer|Mon10:30am} g++ -c test.cpptest.cpp: In function `void ex()':
test.cpp:11: parse error before `*' token
class QRect {
public:
QRect(int, int, int, int) {}
};
void ex() {
double x_[10], y_[10];
int w, h, ns_, i;
// Does not work:
QRect bb2(int(x_[i]*w), int(y_[i]*h), ns_, ns_);
// Does work:
//QRect bb2(int(w*x_[i]), int(y_[i]*h), ns_, ns_);
// Does work:
//QRect bb2((int)(x_[i]*w), int(y_[i]*h), ns_, ns_);
// Does work:
//QRect bb2((int)(w*x_[i]), int(y_[i]*h), ns_, ns_);
}
>How-To-Repeat:
Compile the code and see :)
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: