* c-common.c (c_get_alias_set): Update comment.
authorMark Mitchell <mark@codesourcery.com>
Fri, 20 Aug 1999 21:57:38 +0000 (21:57 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Fri, 20 Aug 1999 21:57:38 +0000 (21:57 +0000)
From-SVN: r28780

gcc/ChangeLog
gcc/c-common.c

index 98229a4df20342d64f9b884ddd7efbcde4a29a34..abe370202527cda1654336fcb804970b46d4d0e5 100644 (file)
@@ -1,3 +1,7 @@
+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>
 
        * linux.h (LIB_SPEC): Added.
index d194be625e46719d2ac0c48e017a4199e77fc852..bcf22109db2518eb820d6b3290f4c429de34ceb5 100644 (file)
@@ -3411,11 +3411,24 @@ c_get_alias_set (t)
         `I *' are different types.  So, we have to pick a canonical
         representative.  We do this below.
         
-        Note that this approach is actually more conservative that it
-        needs to be.  In particular, `const int *' and `int *' should
-        be in different alias sets, but this approach puts them in
-        the same alias set.  */
-
+        Technically, this approach is actually more conservative that
+        it needs to be.  In particular, `const int *' and `int *'
+        chould be in different alias sets, according to the C and C++
+        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 = ((TREE_CODE (type) == POINTER_TYPE)
           ? build_pointer_type (t) : build_reference_type (t));