bug report - error in default parameter resolution

0 views
Skip to first unread message

Bronek Kozicki

unread,
Dec 12, 2003, 6:51:38 AM12/12/03
to
Visual Studio .NET 2003 is refusing to compile following code:


#include <cstdio>

namespace
{
struct Functor
{
template <typename X>
void operator() (X* px)
{
delete px;
}
};

Functor f;
}

template <typename T, T* pf>
struct del_functor_adaptor
{
template <typename X>
static void free(X* px, void (T::*)(X *) = &T::operator() )
{
pf->operator() (px);
}
};


int main()
{
int* a = new int;
del_functor_adaptor<Functor, &f>::free(a);
}


It reports error:

C:\DATA\USERS\bronislaw\My Documents\msys\T147.cpp(22) : error C2059:
syntax error : ')'
C:\DATA\USERS\bronislaw\My Documents\msys\T147.cpp(26) : see
reference to class template instantiation 'del_functor_adaptor<T,pf>'
being compiled
C:\DATA\USERS\bronislaw\My Documents\msys\T147.cpp(22) : error C2143:
syntax error : missing ')' before '<end Parse>'
C:\DATA\USERS\bronislaw\My Documents\msys\T147.cpp(22) : error C2059:
syntax error : ')'
C:\DATA\USERS\bronislaw\My Documents\msys\T147.cpp(35) : see
reference to class template instantiation 'del_functor_adaptor<T,pf>'
being compiled
with
[
T=`anonymous-namespace'::Functor,
pf=& `anonymous-namespace'::f
]
C:\DATA\USERS\bronislaw\My Documents\msys\T147.cpp(22) : error C2143:
syntax error : missing ')' before '<end Parse>'
C:\DATA\USERS\bronislaw\My Documents\msys\T147.cpp(35) : error C2780:
'void del_functor_adaptor<T,pf>::free(X *,void
(`anonymous-namespace'::Functor::* )(X *))' : expects 2 arguments - 1
provided
with
[
T=`anonymous-namespace'::Functor,
pf=& `anonymous-namespace'::f
]
C:\DATA\USERS\bronislaw\My Documents\msys\T147.cpp(22) : see
declaration of 'del_functor_adaptor<T,pf>::free'
with
[
T=`anonymous-namespace'::Functor,
pf=& `anonymous-namespace'::f
]

David Lowndes

unread,
Dec 12, 2003, 9:34:52 AM12/12/03
to
>Visual Studio .NET 2003 is refusing to compile following code:

I can reproduce the problem with VS2003.

FWIW, the Comeau online compiler says the code is OK, and the MS
Whidbey alpha compiler also compiles it cleanly, so whatever the issue
is, it looks like the next MS compiler will resolve it.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq

Carl Daniel [VC++ MVP]

unread,
Dec 12, 2003, 9:40:00 AM12/12/03
to
Bronek Kozicki wrote:
> Visual Studio .NET 2003 is refusing to compile following code:

I was able to reproduce the error with VC7.1.

This appears to be fixed in the current Whidbey alpha version of the
compiler.

-cd

Edward Diener

unread,
Dec 12, 2003, 11:23:45 AM12/12/03
to
David Lowndes wrote:
>> Visual Studio .NET 2003 is refusing to compile following code:
>
> I can reproduce the problem with VS2003.
>
> FWIW, the Comeau online compiler says the code is OK, and the MS
> Whidbey alpha compiler also compiles it cleanly, so whatever the issue
> is, it looks like the next MS compiler will resolve it.

I am curious why MS must wait for Whidbey to fix compiler and IDE problems.
Why are there no service packs forthcoming for VS .NET ? Since the advent of
VS .NET, MS has abandoned service packs for it and developers are constantly
being asked to wait for the next version, which is often more than a year
away. Does MS think it is fun developing software with bugs in it ?


Carl Daniel [VC++ MVP]

unread,
Dec 12, 2003, 11:32:00 AM12/12/03
to
Edward Diener wrote:

> I am curious why MS must wait for Whidbey to fix compiler and IDE
> problems. Why are there no service packs forthcoming for VS .NET ?
> Since the advent of VS .NET, MS has abandoned service packs for it
> and developers are constantly being asked to wait for the next
> version, which is often more than a year away. Does MS think it is
> fun developing software with bugs in it ?

I doubt that.

More practically, it's simply a matter of resources: you can have a new
version in 12-18 months and few to no service packs for older versions, or
you can have service packs and a new version in 24-36 months. Which is
better? Clearly the answer to that will vary from user to user.

The lack of service packs is does not imply the lack of fixes either. If
you're running into a bug that's really hurting your development efforts,
call product support. There are hotfixes available for some issues (for the
record, I have no idea what, if any, hot fixes exist for VC7.1), but you
won't know about them unless you call product support and ask.

-cd


Edward Diener

unread,
Dec 12, 2003, 6:19:57 PM12/12/03
to
Carl Daniel [VC++ MVP] wrote:
> Edward Diener wrote:
>
>> I am curious why MS must wait for Whidbey to fix compiler and IDE
>> problems. Why are there no service packs forthcoming for VS .NET ?
>> Since the advent of VS .NET, MS has abandoned service packs for it
>> and developers are constantly being asked to wait for the next
>> version, which is often more than a year away. Does MS think it is
>> fun developing software with bugs in it ?
>
> I doubt that.
>

It was a rhetorical question.

> More practically, it's simply a matter of resources: you can have a
> new version in 12-18 months and few to no service packs for older
> versions, or you can have service packs and a new version in 24-36
> months. Which is better? Clearly the answer to that will vary from
> user to user.

How about service packs every six months or so, so that people don't have to
wait a year or two for either fixes to the product or new releases without
any fixes to the current product. I think that would be ideal. If there are
very few issues to fix, then the service packs can be stretched out longer
or not put out at all while a new release is imminent.

>
> The lack of service packs is does not imply the lack of fixes either.
> If you're running into a bug that's really hurting your development
> efforts, call product support. There are hotfixes available for some
> issues (for the record, I have no idea what, if any, hot fixes exist
> for VC7.1), but you won't know about them unless you call product
> support and ask.

Do I have unlimited free product support from MS for MS's own bugs in their
Visual Studio product as a licensed user ? I am talking about bugs which
have been confirmed on these NGs as being so, or bugs which no one on these
NGs confirms but which the end-user can easily reproduce. One of the
unfortunate things with MS's lack of a bug report database and an official
bug reporting methodology is that if one reports a bug here, no one may ever
confirm it. That has happened to me in the past, even if many bug reports on
these NGs are spotted and confirmed.


Carl Daniel [VC++ MVP]

unread,
Dec 12, 2003, 7:40:21 PM12/12/03
to
Edward Diener wrote:
> Carl Daniel [VC++ MVP] wrote:
>>
>> The lack of service packs is does not imply the lack of fixes either.
>> If you're running into a bug that's really hurting your development
>> efforts, call product support. There are hotfixes available for some
>> issues (for the record, I have no idea what, if any, hot fixes exist
>> for VC7.1), but you won't know about them unless you call product
>> support and ask.
>
> Do I have unlimited free product support from MS for MS's own bugs in
> their Visual Studio product as a licensed user ?

As I understand it, yes, you do. Calls to PSS which are confirmed to be a
bug in the product are supposed to incur no charges (caveat: I've never
called PSS myself so I have no first-hand knowledge of what the experience
would be).

> I am talking about
> bugs which have been confirmed on these NGs as being so, or bugs
> which no one on these NGs confirms but which the end-user can easily
> reproduce. One of the unfortunate things with MS's lack of a bug
> report database and an official bug reporting methodology is that if
> one reports a bug here, no one may ever confirm it. That has happened
> to me in the past, even if many bug reports on these NGs are spotted
> and confirmed.

Actually, there is an official bug reporting methodology - call PSS.
There's also an internal bug database and, during alpha and beta periods, a
bug database for the alpha/beta. Unfortunately, it's not possible for most
end-users to submit bugs to to those repositories :-( I suppose you could
argue that that's equivalent to their not having a methodology.

-cd


Edward Diener

unread,
Dec 12, 2003, 11:50:57 PM12/12/03
to
Carl Daniel [VC++ MVP] wrote:
> Edward Diener wrote:
>> Carl Daniel [VC++ MVP] wrote:
>>>
>>> The lack of service packs is does not imply the lack of fixes
>>> either. If you're running into a bug that's really hurting your
>>> development efforts, call product support. There are hotfixes
>>> available for some issues (for the record, I have no idea what, if
>>> any, hot fixes exist for VC7.1), but you won't know about them
>>> unless you call product support and ask.
>>
>> Do I have unlimited free product support from MS for MS's own bugs in
>> their Visual Studio product as a licensed user ?
>
> As I understand it, yes, you do. Calls to PSS which are confirmed to
> be a bug in the product are supposed to incur no charges (caveat:
> I've never called PSS myself so I have no first-hand knowledge of
> what the experience would be).

Is there a web page about this ? I am averse to paying a company for
attempting to find a viable solution for me when I report to them their own
bugs.

>
>> I am talking about
>> bugs which have been confirmed on these NGs as being so, or bugs
>> which no one on these NGs confirms but which the end-user can easily
>> reproduce. One of the unfortunate things with MS's lack of a bug
>> report database and an official bug reporting methodology is that if
>> one reports a bug here, no one may ever confirm it. That has happened
>> to me in the past, even if many bug reports on these NGs are spotted
>> and confirmed.
>
> Actually, there is an official bug reporting methodology - call PSS.
> There's also an internal bug database and, during alpha and beta
> periods, a bug database for the alpha/beta. Unfortunately, it's not
> possible for most end-users to submit bugs to to those repositories
> :-( I suppose you could argue that that's equivalent to their not
> having a methodology.

I think that you should add that it is not possible for end-users to view
this bug database either. Yes, I would say that a bug database which neither
allows end-users to report problems directly or see what is in the database
would constitute a weakness in MS's methodology <g>.

Furthermore, being the incredible radical that I am, a bug database which
actually caused MS to provide service packs for a product at decent
intervals, based on the bugs reported there which are impeding and slowing
down programmer productivity, might also constitute an effective
methodology. But I wouldn't want such radical thinking, such incredibly
revolutionary logic, to disturb the status quo. As the great Chinese
philospher Lao-Tse once said, "Those who make waves must know how to swim."
Lao-Tse was a great swimmer.


Gary Chang

unread,
Dec 14, 2003, 8:44:38 PM12/14/03
to
Hi Bronek,

Thanks for posting in the group!

This is a known issue to the VC7.1 compiler, it will be covered in the
Whidbey version.

Thanks again for your concern about VC.NET.


Best regards,
Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------

Gary Chang

unread,
Dec 15, 2003, 1:40:47 AM12/15/03
to
Hi Edward,

Thanks for you posting in the group!

>Is there a web page about this ? I am averse to paying a company for
>attempting to find a viable solution for me when I report to them their own
> bugs.

If you want to report a bug more seriously and need Microsoft
to provide a fix or some workarounds for you with this big, you can visit
the following site:
http://support.microsoft.com

Select "Contact Microsoft"
Then choose "Submit a Request for Online Help" to request an service with
this bug, if our PSS engineers can confirm this bug, they will open a free
case for your issue.

Edward Diener

unread,
Dec 15, 2003, 11:30:53 AM12/15/03
to
Gary Chang wrote:
> Hi Edward,
>
> Thanks for you posting in the group!
>
>> Is there a web page about this ? I am averse to paying a company for
>> attempting to find a viable solution for me when I report to them
>> their own bugs.
>
> If you want to report a bug more seriously and need Microsoft
> to provide a fix or some workarounds for you with this big, you can
> visit the following site:
> http://support.microsoft.com
>
> Select "Contact Microsoft"
> Then choose "Submit a Request for Online Help" to request an service
> with this bug, if our PSS engineers can confirm this bug, they will
> open a free case for your issue.

OK, at least I know how it can be done.


Yan-Hong Huang[MSFT]

unread,
Dec 16, 2003, 2:42:21 AM12/16/03
to
Hello Edward,

Thanks for your feedback on Microsoft product support service.

Generally speaking, if the problem is confirmed by Microsoft PSS as a
product issue, PSS won't charge money. Every MSDN subscriber has two free
support incidents. You could use one of them to contact Microsoft PSS. So
you don't need to pay money yet. Surely if the issue is a product issue,
you still have two free support incidents. :)

If you don't want to contact Microsoft PSS, you could submit product
feedback on
http://register.microsoft.com/mswish/suggestion.asp?&SD=GN&LN=EN-US&gssnb=1.
However, I suggest you contact PSS (if you make sure it is a bug) since
there would be a support professional working with you specially on it.

If there is anything unclear, please feel free to post here. We are glad to
be of assistance.

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! ¨C www.microsoft.com/security

Reply all
Reply to author
Forward
0 new messages