gcc/ada/
	* lib-xref.adb (Generate_Reference): Fix reference to
	Analyze_Assignment.
	* sem_ch5.adb (Diagnose_Non_Variable_Lhs): Reuse existing
	utility function.
                end if;
 
             --  For the left hand of an assignment case, we do nothing here.
-            --  The processing for Analyze_Assignment_Statement will set the
+            --  The processing for Analyze_Assignment will set the
             --  Referenced_As_LHS flag.
 
             else
 
                --  directly.
 
                elsif (Is_Prival (Ent) and then Within_Function)
-                   or else
-                     (Ekind (Ent) = E_Component
-                       and then Is_Protected_Type (Scope (Ent)))
+                   or else Is_Protected_Component (Ent)
                then
                   Error_Msg_N
                     ("protected function cannot modify protected object", N);