SlickEdit Community

SlickEdit Product Discussion => SlickEdit® => Topic started by: Graeme on May 18, 2019, 11:20:14 pm

Title: C++17 inline variables defeat goto definition
Post by: Graeme 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}};
Title: Re: C++17 inline variables defeat goto definition
Post by: Dennis 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.
Title: Re: C++17 inline variables defeat goto definition
Post by: Dennis 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.