Author Topic: libc++ tagging problem  (Read 1328 times)

rjpontefract

  • Senior Community Member
  • Posts: 250
  • Hero Points: 10
libc++ tagging problem
« on: May 15, 2021, 09:25:15 AM »
Hi, I'm running SE 25.0.1(hot fix 6) on macOS 11.3 and I was wandering around a C++ codebase and I ended up following symbols into the standard library.  I then ended up trying to find where true_type and false_type were defined but they were coloured as "symbol not found". 

Some searching later and I found them in type_traits and I'm trying to figure out why the tagging engine didn't also find them. 

Is there someway I can get SE to tag them correctly.  They are defined as shown in the attached screen capture.  I have _LIBCPP_STD_VER defined as 20 to include C++ 20 features.  Why does the tagging engine see them as "not found" and why does it not like the template parameters?  Is there something I need to define to make this work?  Any pointers would be appreciated.

Dennis

  • Senior Community Member
  • Posts: 3961
  • Hero Points: 517
Re: libc++ tagging problem
« Reply #1 on: May 15, 2021, 02:01:16 PM »
You may need to add that #define _LIBCPP_BOOL_CONSTANT() to your C/C++ Preprocessing.  Document > C/C++ Options > C/C++ Preprocessing.

I'll take a closer look at this, and see if I can update the pre-defined C/C++ defines on macOS next week.

rjpontefract

  • Senior Community Member
  • Posts: 250
  • Hero Points: 10
Re: libc++ tagging problem
« Reply #2 on: May 16, 2021, 08:29:20 AM »
Thanks Dennis, that certainly helped.  I'm still unsure as to why template parameters are shown as not found, even in the location that they are declared.  There must be some logic to this that I'm missing.

An update to the MacOS defines would be appreciated as having tags available certainly helps when exploring a code base.

rjpontefract

  • Senior Community Member
  • Posts: 250
  • Hero Points: 10
Re: libc++ tagging problem
« Reply #3 on: May 23, 2021, 03:54:56 AM »
It seems that SE doesn't understand alias templates such as:

template <class _Tp>
using __optional_sfinae_ctor_base_t = __sfinae_ctor_base<
    is_copy_constructible<_Tp>::value,
    is_move_constructible<_Tp>::value
>;

SE considers the template argument _Tp as an undefined symbol.  Without the type alias, the template arguments are tagged correctly.

This has a knock on effect where those alias templates are used, such as:

template <class _Tp>
class optional
    : private __optional_move_assign_base<_Tp>
    , private __optional_sfinae_ctor_base_t<_Tp>
    , private __optional_sfinae_assign_base_t<_Tp>
{

where they are also tagged incorrectly.

Hope this is something that can be fixed.

Dennis

  • Senior Community Member
  • Posts: 3961
  • Hero Points: 517
Re: libc++ tagging problem
« Reply #4 on: May 24, 2021, 02:13:07 PM »
I'll look into it sometime this week.  It looks like those are tagged correctly, but there could be some other code that is not looking for alias templates.

Dennis

  • Senior Community Member
  • Posts: 3961
  • Hero Points: 517
Re: libc++ tagging problem
« Reply #5 on: August 31, 2021, 02:43:24 PM »
I added that #define to the standard ones we ship with SlickEdit.

I also fixed the tagging so that it picks up local template parameters for C++ using statements.  Good catch.

Sorry it took a while to get to this one.  The fixes will be in v26, BETA 3.

rjpontefract

  • Senior Community Member
  • Posts: 250
  • Hero Points: 10
Re: libc++ tagging problem
« Reply #6 on: August 31, 2021, 08:56:05 PM »
That's good to hear. Thanks Dennis, it's appreciated.