473,890 Members | 1,760 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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::CExpres sion< T2, Detail::CExpres sion<T1,TExpr> >
operator+( const Detail::CExpres sion<T1,TExpr>& expr
, const CNamedTypedPara meter<T2>& par )
{
return Detail::CExpres sion< T2, Detail::CExpres sion<T1,TExpr> >( par, expr );
//return Detail::CExpres sion< T2, Detail::CExpres sion<T1,TExpr>( par, expr);
}

The code compiles fine as it is. Uncommenting commented
line (which misses a closing bracket) causes
error C2665: 'Detail::CExpre ssion<T,TExpr>: :__ctor' :
none of the 2 overloads can convert parameter 2 from type 'const Detail::CExpres sion<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 1650
>From: "Hendrik Schober" <Sp******@gmx.d e>
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******@onlin e.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
2083
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 to get a working system just about finished. I am building an interface for our customer service folks to use to manage registered customers and am seeing some weird behavior.
5
14638
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 a total mistery. I have a function inside an ASP page as a result of which I get the following error message: Microsoft VBScript compilation error '800a03ea'
0
1364
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 items dynamically added}) All the code works #1 when only the MdiParent form is used, as soon as i open an MdiChild in it, right after the popup event returns, i get this error: ...
2
2541
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 has been compiled with no error for days. The code was Me.CircuitQualifier.Requery
6
1555
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 Char : 1 Error:Syntax error
0
9812
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10799
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10899
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10446
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9614
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7154
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5832
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6032
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4655
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.