In my C++ code, in a file that I include from StdAfx.h, I have a declaration like this:
#ifdef _PC_LINT_
#define BEGIN_NAMESPACE namespace MyNamespace {
#define END_NAMESPACE }
#define USE_NAMESPACE using namespace MyNamespace
#else // #ifdef _PC_LINT_
#define BEGIN_NAMESPACE
#define END_NAMESPACE
#define USE_NAMESPACE /**/
#endif // #ifdef _PC_LINT_
// ...
BEGIN_NAMESPACE
// ...
class A {
// ...
};
class B {
// ...
};
END_NAMESPACE
USE_NAMESPACE
All classes are declared in a single .h, but the implementations are spread over different modules.
Apparently, this code isn't parsed correctly. When I position the caret over a member function, the left combobox in the source file window shows the namespace as part of the name. However, when positioning the caret over the definition of the method in the .cpp file, the namespace isn't included in the name.
Interestingly enough, using the declaration below fixes the problem:
#ifndef _PC_LINT_
#define BEGIN_NAMESPACE
#define END_NAMESPACE
#define USE_NAMESPACE /**/
#else // #ifndef _PC_LINT_
#define BEGIN_NAMESPACE namespace MyNamespace {
#define END_NAMESPACE }
#define USE_NAMESPACE using namespace MyNamespace
#endif // #ifndef _PC_LINT_
Can you reproduce this behavior for a small example?
How does VAX treat preprocessor macros that aren't defined anywhere? _PC_LINT_ is defined only when the code is lint-ed, no defining reference whatsoever in the sources.