473,782 Members | 2,505 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 1648
>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
2081
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
14630
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
1358
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
2535
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
1550
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
9639
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9479
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
10311
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10146
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
10080
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
8967
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...
1
7492
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6733
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();...
1
4043
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.