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

Graeme

  • Senior Community Member
  • Posts: 2391
  • Hero Points: 315
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

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2834
  • Hero Points: 431
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

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2834
  • Hero Points: 431
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.