This is the mail archive of the gcc-prs@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]

c++/396: Re: const int null = 0;



>Number:         396
>Category:       c++
>Synopsis:       const int null = 0;
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          analyzed
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Mon Jul 10 00:06:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     "Marc A. Lepage" <mlepage@molecularmining.com>
>Release:        2.95.2
>Organization:
Molecular Mining Corporation
>Environment:
>Description:
 Original-Message-ID: <38FB65DA.2564557F@molecularmining.com>
 Date: Mon, 17 Apr 2000 15:28:26 -0400
 

 kafka$ gcc -v
 Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/specs
 gcc version 2.95.2 19991024 (release)
 kafka$ uname -a
 Linux kafka 2.2.5 #1 SMP Mon Apr 12 02:29:46 EDT 1999 i686 unknown
 kafka$ g++ null.cpp 
 null.cpp: In method `void Foo::g()':
 null.cpp:27: no matching function for call to `Foo::f (const int &)'
 null.cpp:21: candidates are: void Foo::f(int *)
 null.cpp: In function `int main(int, char *)':
 null.cpp:37: no matching function for call to `Foo::f (const int &)'
 null.cpp:21: candidates are: void Foo::f(int *)
>How-To-Repeat:
const int null = 0;

void f(int* pn)
{
}

void g()
{
    f(0);
    f(null); // okay
}

class Foo
{
public:
    void f(int* pn);
    void g();
};

void Foo::f(int* pn)
{
}

void Foo::g()
{
    f(0);
    f(null); // compile error
}

int main(int argc, char* argv)
{
    f(0);
    f(null); // okay

    Foo foo;
    foo.f(0);
    foo.f(null); // compile error
}
>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]