This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/6923: Ex of g++ 3.1 not compiling apparently valid code


>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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]