FIX: C1001: Internal Compiler Error: getattr.c Line 346
PSS ID Number: Q107434
Article last modified on 07-14-1994

7.00

MS-DOS


----------------------------------------------------------------------
The information in this article applies to:

 - Microsoft C/C++ for MS-DOS, version 7.0
----------------------------------------------------------------------

SYMPTOMS
========

The compiler generates the following error when trying to send the
address of a user-defined data type to cout:

   fatal error C1001: INTERNAL COMPILER ERROR
                (compiler file '2pass/getattr.c', line 346)

RESOLUTION
==========

Don't take the address of a data type. Define an instance of that type
and take the address of that.

STATUS
======

This problem has been corrected in C/C++ version 8.0, which correctly
generates the following error:

   error C2275: 'error' : illegal use of this type as an expression

Sample Code
-----------

/* Compile options needed: None
*/

#include <iostream.h>

struct test
{¬
  int var;
};

typedef test *error;

void main()
{¬
  cout << &error[0];   // Line that generates the C1001
}

Additional reference words: 7.00
KBCategory: Tls
KBSubcategory: CPPIss

=============================================================================

Copyright Microsoft Corporation 1994.
