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

rjpontefract

  • Community Member
  • Posts: 99
  • Hero Points: 4
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

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

  • Community Member
  • Posts: 99
  • Hero Points: 4
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

  • Community Member
  • Posts: 99
  • Hero Points: 4
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

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