Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Internal compiler error when upgrading from 7.0 to 7.1

0 views
Skip to first unread message

Joaquín Mª López Muñoz

unread,
May 5, 2003, 3:01:16 PM5/5/03
to
The library at this URL:

http://www.codeproject.com/vcpp/stl/bimap.asp

used to compile OK with 7.0, but I've been informed that
it produces an internal compiler error in MSVC 7.1. The
error is reproducible by compiling the test suite
accompanying the library (same URL).
I've made some tweaking in the code to no avail. The
library works well with other compilers, notably GCC 3.2,
which I regard highly when it comes to standard compliance.
Any hint about what's going on or workarounds to make
the code compile are most welcome.
Best regards,

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo

Keiji Oenoki [MSFT]

unread,
May 7, 2003, 2:25:26 PM5/7/03
to
Hi Joaquín,

> Any hint about what's going on or workarounds to make
> the code compile are most welcome.
> Best regards,

The compiler cannot handle the case when you hava a nested class and a
member data with the same identifier, as in:

---
struct a {
struct b {
...
} b;
};
---

Here the lookup of "b" in the context of struct a can find either the type
a::b or the member a::b, which confuses the compiler. I see this construct
being used in prebimap::from and prebimap::to. You can either change the
class name or the member name and the ICE will be gone.

You will, however, encounter another issue, which is access control
related. The following example illustrates the issue:

---
class A {
typedef int from_type;
};
template <typename from_type>
struct B: A {
from_type n; // which from_type?
};
---

Does B::from_type refer to the typedef in class A, which is private, or the
template parameter "from_type"? Per 14.6.1 par 7, the lookup finds
A::from_type, hence an accessibility error. The fix is to either rename the
template parameter or the nested type, and change the use of the type if
needed.

I didn't go further than this. If after fixing these two issues you still
cannot get it to compile, please let me know.


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

0 new messages