Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 1538: weird symbol lookup

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
sl@sh Posted - Oct 30 2006 : 05:17:38 AM
On some occasions I noticed VAX looking at very weird locations to resolve locally defined symbols. As the solution I'm working on is rather complex I didn't pay too much attention to it, but now I was able to pinpoint it on one of my most basic base classes.

The problem I'm referring to is that VAX sometimes doesn't recognizy symbols correctly that are actually defined locally or within the class scope. The symptoms are as follows:

1) When I hover over the symbol, no tooltip shows, or a tooltip showing a wrong reference
2) When I try to dereference the symbol using '.' I don't get the right list of members.
3) When I force a suggestion list after placing my cursor behind the '.', I sometimes *do* get the right member list, but sometimes I still get the wrong list (and often not the same as the one initially appearing)
4) The symptoms listed above don't neccessarily appear all at the same time, and when I rename the symbol within my local scope I often get different symptom combinations.
5) When I type a correct completion following the '.', the compiler does accept it (and the resulting program runs just fine), but VAX underlines it as wrong.

Here's a stripped down version of my class:

header streamable.h:

#pragma once
#include <iostream>

class Streamable
{
protected:
    static const char SEP=' '; // separator for standard IO of multiple data members
public:
    virtual std::ostream& put(std::ostream& os) const=0;
    virtual std::istream& get(std::istream& is)=0;
};
std::ostream& operator<< (std::ostream& os, const Streamable& obj);
std::istream& operator>> (std::istream& is, Streamable& obj);


implementation file:

#include "streamable.h"
std::ostream& operator<< (std::ostream& os, const Streamable& obj)
{
    return obj.put (os);
}
std::istream& operator>> (std::istream& is, Streamable& obj)
{
    return obj.get (is);
}

When using VS 2003 and 1538 I get the described symptoms within the definition of the operator << () function, at the line
return obj.put (os);

The weird thing is that operator>>(), while defined in a very similar way does not show the same symptoms, I even could add a line
obj.put(std::cout)
without a problem.

The operator<< function shows this behavior no matter how I rename the local variable obj, and depending on the name I choose I get varying symptoms.
1   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Oct 30 2006 : 10:54:00 AM
Thank you for the very clear example, I see exactly the same problem here.

case=3314

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000