Author Topic: C++17 inline variables defeat goto definition  (Read 1613 times)

Graeme

  • Senior Community Member
  • Posts: 2796
  • Hero Points: 347
C++17 inline variables defeat goto definition
« on: May 18, 2019, 11:20:14 PM »
C++17 supports inline variables which allows you to put the definition of a variable in a header file without violating the one definition rule.  I have the code below in a header file.  When I use Ctrl-dot for the word mui_table_info in a C++ file, slick is unable to find the definition.
Using v23.0.1.2 64-bit no hotfixes.

Code: [Select]
inline const struct
{
   int      offset;      // byte offset into zone_image struct
   int      len;         // fixed length in bytes if positive, else enum type_e
   int      source;      // identifies where the data is to be copied *from*
   uchar    data_type;
}
mui_table_info[] =
{ {1,2,3,4}};
« Last Edit: May 18, 2019, 11:24:54 PM by Graeme »

Dennis

  • Senior Community Member
  • Posts: 3962
  • Hero Points: 517
Re: C++17 inline variables defeat goto definition
« Reply #1 on: May 20, 2019, 02:20:45 PM »
Will try to patch this up for the next build.  I have to say, this is a really asinine syntax for what it is trying to accomplish.

Dennis

  • Senior Community Member
  • Posts: 3962
  • Hero Points: 517
Re: C++17 inline variables defeat goto definition
« Reply #2 on: May 20, 2019, 08:30:50 PM »
Fixed for the next release.  This sort of parsing bug is not hot-fixable.  Thanks for pointing this one out.