473,394 Members | 1,703 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Weird error message with VC7.1

Hi,

I have some expression template code that I want to
get to work. I had a typo in it and just spent two
hours to find it, because VC7.1 gave a really weird
error message for it.
This is the code:

template< typename T1, typename TExpr, typename T2>
inline
Detail::CExpression< T2, Detail::CExpression<T1,TExpr> >
operator+( const Detail::CExpression<T1,TExpr>& expr
, const CNamedTypedParameter<T2>& par )
{
return Detail::CExpression< T2, Detail::CExpression<T1,TExpr> >( par, expr );
//return Detail::CExpression< T2, Detail::CExpression<T1,TExpr>( par, expr);
}

The code compiles fine as it is. Uncommenting commented
line (which misses a closing bracket) causes
error C2665: 'Detail::CExpression<T,TExpr>::__ctor' :
none of the 2 overloads can convert parameter 2 from type 'const Detail::CExpression<T,TExpr>'

OK, by the standard, this should be fine. I fed the
compiler none-conforming code and it spit out a
diagnostic. However, it's a very misleading one!

Did anybody else see something like this? Is it worth
spending the time to distill a repro from the code?

Schobi

--
Sp******@gmx.de is never read
I'm Schobi at suespammers org

"My hair style calls into immediate question all my judgements."
Scott Meyers
(http://www.google.de/groups?selm=MPG...ws.hevanet.com)
Nov 16 '05 #1
2 1629
>From: "Hendrik Schober" <Sp******@gmx.de>
Subject: Weird error message with VC7.1
Date: Mon, 11 Aug 2003 17:06:14 +0200
Lines: 41

Hi,
<snip>

OK, by the standard, this should be fine. I fed the
compiler none-conforming code and it spit out a
diagnostic. However, it's a very misleading one!

Did anybody else see something like this? Is it worth
spending the time to distill a repro from the code?

Schobi

--


Getting decent compiler diagnostics for template error messages is a
problem for all C++ compilers
not just for the Visual C++ compiler -- the problem with templates and
especially with deeply nested
templates is that the compiler can very quickly lose the context of the
user code: one rather simple
line of user code can cause the compiler to go off an instantiate 10's if
not 100's of other class
templates. We are trying to do a better job with each release: hopefully at
some point all compilers
will have clean, concise, actionable error messages for all template
diagnostics.

--
Jonathan Caves, Visual C++ Team
This posting is provided AS IS with no warranties, and confers no rights.

Nov 16 '05 #2
"Jonathan Caves [MSFT]" <jo******@online.microsoft.com> wrote:

Hi Jonathan,
[...]
Getting decent compiler diagnostics for template error messages is a
problem for all C++ compilers
not just for the Visual C++ compiler
Oh, I had to learn that already! :o>
-- the problem with templates and
especially with deeply nested
templates is that the compiler can very quickly lose the context of the
user code: one rather simple
line of user code can cause the compiler to go off an instantiate 10's if
not 100's of other class
templates.
I don't think that's the case here. In fact, I
think the message came up with rather simple
code. (I was, after all, still able to understand
what really was going on, once I found the typo.
And I'm usually quite bad with understanding that
template meta stuff...)
We are trying to do a better job with each release: hopefully at
some point all compilers
will have clean, concise, actionable error messages for all template
diagnostics.
Well, I'd settle for the compilers I have to use. :^>
Jonathan Caves, Visual C++ Team


Schobi

--
Sp******@gmx.de is never read
I'm Schobi at suespammers org

"My hair style calls into immediate question all my judgements."
Scott Meyers
(http://www.google.de/groups?selm=MPG...ws.hevanet.com)
Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: redneck_kiwi | last post by:
Hi all: I have a really weird problem. I am developing a customer catalog system for my company and as such have delved into sessions for authentication and access levels. So far, I have managed...
5
by: NanQuan | last post by:
I'm hoping someone can help me solve this error since I am at a total loss here. Usually I don't bother posting on any forums or groups on the internet and prefer to solve stuff myself but this is...
0
by: Deutsche Dogge | last post by:
Hi. I'M having a weird problem with addign menuitems to a menu dynamically on the popup event of the menuitem containing the container of the menuitems i wanna add (tools -> external -> {list of...
2
by: Kathy Houtami | last post by:
Hi there I've been encountered with weird compile error using Access 97. The error message is "Member or data member is not found" and it highlighted a line of code that has not be changed and...
6
by: gh0st54 | last post by:
Hi I have a weird javascript error that only happens on my live server when i open the page http://www.imrated.co.uk/reg.aspx i get the error 'Problems with this page ... blablabla Line : 3...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.