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] | |
This patch properly analyses aspects in cases when scopes differ such as
protected types, tasks, etc.
The test illustrates the analysis of aspects at freeze point specified for a
protected object.
------------
-- Source --
------------
package T is
type Typ is new Integer with Size => 128;
protected type Prot with Lock_Free => True is
procedure Reset;
private
Counter : Typ := 0;
end Prot;
end T;
package body T is
protected body Prot is
procedure Reset is
begin
Counter := 0;
end Reset;
end Prot;
end T;
-----------------
-- Compilation --
-----------------
$ gnatmake -q -gnat12 t.adb
t.adb:3:07: illegal body when Lock_Free given
t.adb:5:10: type of "Counter" must support atomic operations
gnatmake: "t.adb" compilation error
Tested on x86_64-pc-linux-gnu, committed on trunk
2012-08-06 Vincent Pucci <pucci@adacore.com>
* sem_ch13.adb: Current scope must be within
or same as the scope of the entity while analysing aspect
specifications at freeze point.
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] |