git-svn-id: branches/joost/classattributes@22967 -
@@ -10486,6 +10486,7 @@ tests/test/tclassattribute4.pp svneol=native#text/plain
tests/test/tclassattribute5.pp svneol=native#text/plain
tests/test/tclassattribute6.pp svneol=native#text/plain
tests/test/tclassattribute7.pp svneol=native#text/plain
+tests/test/tclassattribute8.pp svneol=native#text/plain
tests/test/tclassinfo1.pp svneol=native#text/pascal
tests/test/tclrprop.pp svneol=native#text/plain
tests/test/tcmov1.pp svneol=native#text/plain
@@ -870,8 +870,9 @@ implementation
generictypelist.free;
end;
- if Assigned(current_rtticlassattributesdef) then
- internalerror(202105250);
+ if assigned(current_rtticlassattributesdef) and (current_rtticlassattributesdef.get_attribute_count>0) then
+ Message1(scan_e_unresolved_attribute,trtti_attribute(current_rtticlassattributesdef.rtti_attributes[0]).typesym.prettyname);
+
until ((token<>_ID) and (token<>_LECKKLAMMER)) or
(in_structure and
((idtoken in [_PRIVATE,_PROTECTED,_PUBLIC,_PUBLISHED,_STRICT]) or
@@ -0,0 +1,35 @@
+program tclassattribute8;
+{$mode objfpc}{$H+}
+uses
+ typinfo;
+type
+ { tmyt }
+ TMyt = class(TCustomAttribute)
+ constructor create;
+ end;
+ { TMyObject }
+ [TMyt]
+ TMyObject = class(TObject)
+ // Attributes for integers are not allowed, so the following should fail, since
+ // there is nothing to bind the attribute to.
+ int = integer;
+constructor TMyt.create;
+begin
+end;
+end.