OSDN Git Service

* common.opt (Wmudflap): New option.
[pf3gnuchains/gcc-fork.git] / gcc / ada / sem_ch6.adb
index 5f51369..9aaa37f 100644 (file)
@@ -6996,18 +6996,17 @@ package body Sem_Ch6 is
 
             Analyze_Per_Use_Expression (Default, Formal_Type);
 
-            --  Check that an access to constant is not used with an
-            --  access type.
+            --  An access to constant cannot be the default for
+            --  an access parameter that is an access to variable.
 
             if Ekind (Formal_Type) = E_Anonymous_Access_Type
               and then not Is_Access_Constant (Formal_Type)
               and then Is_Access_Type (Etype (Default))
               and then Is_Access_Constant (Etype (Default))
             then
-               Error_Msg_NE ("parameter of type& cannot be initialized " &
-                             "with an access-to-constant expression",
-                             Default,
-                             Formal_Type);
+               Error_Msg_N
+                 ("formal that is access to variable cannot be initialized " &
+                    "with an access-to-constant expression", Default);
             end if;
 
             --  Check that the designated type of an access parameter's default