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++/7725: g++ cannot convert 0 to int* as template arg.


>Number:         7725
>Category:       c++
>Synopsis:       g++ cannot convert 0 to int* as template arg.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 26 06:56:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     zyzstar@uid0.sk
>Release:        g++-3.1.1
>Organization:
>Environment:

>Description:
template <int* P>
class C
{
public:
	C() :p(P) {}
	~C() {}
	int* p;
};

int main()
{
    C<0> c;
    return 0;
}

This code does not work.
g++ does not accept 0 as a valid
template parameter for pointers.
>How-To-Repeat:

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