* fix #40592: make the Delphi-compatible attributes usable, but in a way that makes it clear to the user that they won't work

+ added test
This commit is contained in:
Sven/Sarah Barth 2024-01-15 21:40:34 +01:00
parent 1ffef6ed41
commit dd4f7e9148
3 changed files with 41 additions and 4 deletions

View File

@ -1308,6 +1308,18 @@ end;
inherited;
end;
{****************************************************************************
TCustomAttribute
****************************************************************************}
constructor TUnimplementedAttribute.Create;
begin
inherited;
end;
{****************************************************************************
TCustomStoredAttribute
****************************************************************************}

View File

@ -502,10 +502,16 @@
constructor Create;
end;
{$POP}
WeakAttribute = class(TCustomAttribute);
UnsafeAttribute = class(TCustomAttribute);
RefAttribute = class(TCustomAttribute);
VolatileAttribute = class(TCustomAttribute);
TUnimplementedAttribute = class(TCustomAttribute)
public
constructor Create; unimplemented;
end;
WeakAttribute = class(TUnimplementedAttribute);
UnsafeAttribute = class(TUnimplementedAttribute);
RefAttribute = class(TUnimplementedAttribute);
VolatileAttribute = class(TUnimplementedAttribute);
StoredAttribute = Class(TCustomAttribute)
Private

19
tests/webtbs/tw40592.pp Normal file
View File

@ -0,0 +1,19 @@
{ %NORUN }
program tw40592;
{$mode objfpc}
{$modeswitch prefixedattributes}
type
[Volatile]
[Unsafe]
[Weak]
[Ref]
TTest = class
end;
begin
end.