c++/8295: problem with method name log2

aiguo_1997@yahoo.com aiguo_1997@yahoo.com
Sun Oct 20 20:06:00 GMT 2002

>Number:         8295
>Category:       c++
>Synopsis:       problem with method name log2
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Oct 20 20:06:00 PDT 2002
>Originator:     aiguo_1997@yahoo.com
>Release:        gcc version 3.2 20020818 (prerelease)
Compiler fails to compile if there is a member function named log2() taking more than 1 parameters and the header <iostream> is included. Error says "gcc version 3.2 20020818 (prerelease)", possibly caused the the math macro log2(). No error if <iostream> is not included (possibly iostream uses log2 math macro).
The following simple code will produce the error:

#include <iostream>

class myLog{
inline virtual void log2( int x, int x2 ){}
int main()
return 0;



More information about the Gcc-bugs mailing list