This is the mail archive of the gcc-patches@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]

[Ada] Syntax error detection on Ghost abstract states


This patch modifies the analysis of pragma Abstract_State to detect a syntax
error related to a state with a simple option.

------------
-- Source --
------------

--  malformed_state.ads

package Malformed_State
  with SPARK_Mode,
       Abstract_State => (State1, State2 => Ghost)
is
end Malformed_State;

----------------------------
-- Compilation and output --
----------------------------

$ gcc -c malformed_state.ads
malformed_state.ads:3:42: malformed abstract state declaration
malformed_state.ads:3:42: use "with" to specify simple option

Tested on x86_64-pc-linux-gnu, committed on trunk

2015-03-04  Hristian Kirtchev  <kirtchev@adacore.com>

	* sem_prag.adb (Analyze_Abstract_State): Use routine
	Malformed_State_Error to issue general errors.
	(Analyze_Pragma): Diagnose a syntax error related to a state
	declaration with a simple option.
	(Malformed_State_Error): New routine.

Attachment: difs
Description: Text document


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