{"action":"opened","issue":{"url":"https://api.github.com/repos/ghdl/ghdl/issues/552","repository_url":"https://api.github.com/repos/ghdl/ghdl","labels_url":"https://api.github.com/repos/ghdl/ghdl/issues/552/labels{/name}","comments_url":"https://api.github.com/repos/ghdl/ghdl/issues/552/comments","events_url":"https://api.github.com/repos/ghdl/ghdl/issues/552/events","html_url":"https://github.com/ghdl/ghdl/issues/552","id":313207298,"number":552,"title":"Wrong range of type'image strings","user":{"login":"stefanunrein","id":37802753,"avatar_url":"https://avatars3.githubusercontent.com/u/37802753?v=4","gravatar_id":"","url":"https://api.github.com/users/stefanunrein","html_url":"https://github.com/stefanunrein","followers_url":"https://api.github.com/users/stefanunrein/followers","following_url":"https://api.github.com/users/stefanunrein/following{/other_user}","gists_url":"https://api.github.com/users/stefanunrein/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanunrein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanunrein/subscriptions","organizations_url":"https://api.github.com/users/stefanunrein/orgs","repos_url":"https://api.github.com/users/stefanunrein/repos","events_url":"https://api.github.com/users/stefanunrein/events{/privacy}","received_events_url":"https://api.github.com/users/stefanunrein/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-11T07:39:47Z","updated_at":"2018-04-11T07:39:47Z","closed_at":null,"author_association":"NONE","body":"Hello I found a bug with type'image strings.\r\nIf I pass a type'image to a function it starts from range 0 instead from 1.\r\n\r\nGHDL version:\r\nGHDL 0.36-dev (tarball) [Dunoon edition]\r\nCompiled with GNAT Version: GPL 2017 (20170515-63)\r\n\r\n```vhdl\r\nlibrary IEEE;\r\nuse IEEE.STD_LOGIC_1164.ALL;\r\nuse IEEE.NUMERIC_STD.ALL;\r\n\r\nentity strings_test is\r\nend strings_test;\r\n\r\narchitecture rtl of strings_test is\r\n\ttype T_TYPE\t\t\t\tis (TYPE_1, TYPE_2, TYPE_3);\r\n\r\n\tfunction str_low(str : string) return integer is\r\n\tbegin\r\n\t\treturn str'low;\r\n\tend function;\r\n\t\r\n\tconstant string1 : string := \"TYPE_1\";\r\n\tconstant string2 : T_TYPE := TYPE_1;\r\n\t\r\nbegin\r\n\r\nassert false report \"str_low of type'image     : i =\" & integer'image(str_low(T_TYPE'image(string2))) severity note;\r\nassert false report \"tic low of type'image     : i =\" & integer'image(T_TYPE'image(string2)'low) severity note;\r\nassert false report \"tic low of string         : i =\" & integer'image(string1'low) severity note;\r\nassert false report \"str_low of string         : i =\" & integer'image(str_low(string1)) severity note;\r\n\r\nend rtl;\r\n```\r\n\r\nCommands to call ghdl:\r\n```bash\r\n ghdl -a --std=93 .\\string_of_type_test.vhd\r\n ghdl -a --std=08 .\\string_of_type_test.vhd\r\n ghdl -r --std=93 strings_test\r\n ghdl -r --std=08 strings_test\r\n```\r\n\r\nOutput for 93:\r\n```bash\r\n.\\string_of_type_test.vhd:22:1:@0ms:(assertion note): str_low of type'image     : i =0\r\n.\\string_of_type_test.vhd:23:1:@0ms:(assertion note): tic low of type'image     : i =1\r\n.\\string_of_type_test.vhd:24:1:@0ms:(assertion note): tic low of string         : i =1\r\n.\\string_of_type_test.vhd:25:1:@0ms:(assertion note): str_low of string         : i =1\r\n```\r\n\r\nOutput for 08:\r\n```bash\r\n.\\string_of_type_test.vhd:22:1:@0ms:(assertion note): str_low of type'image     : i =0\r\n.\\string_of_type_test.vhd:23:1:@0ms:(assertion note): tic low of type'image     : i =1\r\n.\\string_of_type_test.vhd:24:1:@0ms:(assertion note): tic low of string         : i =1\r\n.\\string_of_type_test.vhd:25:1:@0ms:(assertion note): str_low of string         : i =1\r\n```\r\n\r\nExpected:\r\n```bash\r\n.\\string_of_type_test.vhd:22:1:@0ms:(assertion note): str_low of type'image     : i =1\r\n.\\string_of_type_test.vhd:23:1:@0ms:(assertion note): tic low of type'image     : i =1\r\n.\\string_of_type_test.vhd:24:1:@0ms:(assertion note): tic low of string         : i =1\r\n.\\string_of_type_test.vhd:25:1:@0ms:(assertion note): str_low of string         : i =1\r\n```"}}
{"actor":{"display_login":"stefanunrein"}}