Commit b61148dd by Mark Mitchell Committed by Mark Mitchell

* c-common.c (c_get_alias_set): Update comment.

From-SVN: r28780
parent f2655b99
Fri Aug 20 15:02:10 1999 Mark Mitchell <mark@codesourcery.com>
* c-common.c (c_get_alias_set): Update comment.
1999-08-20 Andreas Jaeger <aj@arthur.rhein-neckar.de> 1999-08-20 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* linux.h (LIB_SPEC): Added. * linux.h (LIB_SPEC): Added.
......
...@@ -3411,11 +3411,24 @@ c_get_alias_set (t) ...@@ -3411,11 +3411,24 @@ c_get_alias_set (t)
`I *' are different types. So, we have to pick a canonical `I *' are different types. So, we have to pick a canonical
representative. We do this below. representative. We do this below.
Note that this approach is actually more conservative that it Technically, this approach is actually more conservative that
needs to be. In particular, `const int *' and `int *' should it needs to be. In particular, `const int *' and `int *'
be in different alias sets, but this approach puts them in chould be in different alias sets, according to the C and C++
the same alias set. */ standard, since their types are not the same, and so,
technically, an `int **' and `const int **' cannot point at
the same thing.
But, the standard is wrong. In particular, this code is
legal C++:
int *ip;
int **ipp = &ip;
const int* const* cipp = &ip;
And, it doesn't make sense for that to be legal unless you
can dereference IPP and CIPP. So, we ignore cv-qualifiers on
the pointed-to types. This issue has been reported to the
C++ committee. */
t = TYPE_MAIN_VARIANT (TREE_TYPE (type)); t = TYPE_MAIN_VARIANT (TREE_TYPE (type));
t = ((TREE_CODE (type) == POINTER_TYPE) t = ((TREE_CODE (type) == POINTER_TYPE)
? build_pointer_type (t) : build_reference_type (t)); ? build_pointer_type (t) : build_reference_type (t));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment