bug report - error in default parameter resolution

B

Bronek Kozicki

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::blush:perator() )
{
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
]
 
D

David Lowndes

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
 
C

Carl Daniel [VC++ MVP]

Bronek said:
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
 
E

Edward Diener

David said:
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 ?
 
C

Carl Daniel [VC++ MVP]

Edward said:
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
 
E

Edward Diener

Carl said:
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.
 
C

Carl Daniel [VC++ MVP]

Edward said:
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
 
E

Edward Diener

Carl said:
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.
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.
 
G

Gary Chang

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.
--------------------
 
G

Gary Chang

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.


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.
--------------------
 
E

Edward Diener

Gary said:
Hi Edward,

Thanks for you posting in the group!


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.
 
Y

Yan-Hong Huang[MSFT]

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
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top