This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Canonical type nodes, or, comptypes considered harmful


"Bernhard R. Link" <brl@pcpool00.mathematik.uni-freiburg.de> writes:

| * Ian Lance Taylor <iant@google.com> [061108 16:15]:
| > This assumes, of course, that we can build an equivalence set for
| > types.  I think that we need to make that work in the middle-end, and
| > force the front-ends to conform.  As someone else mentioned, there are
| > horrific cases in C like a[] being compatible with both a[5] and a[10]
| > but a[5] and a[10] not being compatible with each other, and similarly
| > f() is compatible with f(int) and f(float) but the latter two are not
| > compatible with each other.
| 
| Isn't void* and anyothertype* the same case?
| And how are classes and parent classes made compatible in C++?

For C++, in computing the canonical type, you typicall don't use
"compatible."  You ultimately use the quintescence of the ODR.
void* is a type different from "anyothertype*".  
Similarly, a class is different from its base classes.

| Is the
| front end always making a implicit type conversion or are they 'equivalent'
| in one direction?

There is no implicit conversion.

-- Gaby


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]