Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 trailing return types support
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

bta
Ketchup Master

Belgium
57 Posts

Posted - Apr 08 2020 :  05:04:20 AM  Show Profile  Reply with Quote
Hi,

any progress on supporting trailing return types?
(https://en.cppreference.com/w/cpp/language/function)

Consider the following piece of code:

class Bart
   {
   public:
      explicit Bart() = default;
      ~Bart() = default;
      Bart(const Bart &other) = delete;
      Bart(Bart &&other) = delete;
      auto operator=(const Bart &other) -> Bart& = delete;
      auto operator=(Bart &&other) -> Bart& = delete;

      auto foo(int param) const -> int
         {
         return 50;
         }
      int foo2(int param) const
         {
         return 242;
         }
   };

auto someFct() -> void
   {
   auto b = Bart{};
   b.foo(1);
   b.foo2(2);
   }


This is the way it is shown in VisualStudio:



You can clearly see the unrecognized trailing return types of Bart::foo() and someFct().

When hovering over the method foo (with trailing return type), the return type is not shown:



Same thing works fine when hovering over foo2 (old school return style):



The code completion seems to handle it better:




Note that this one even shows the fact that it is const (and when adding virtual or overwrite, that is shown as well...

I think that all tooltips from the screenshots are shown by VAX, since when I disable VAX,
no tooltips are shown when doing the same actions.

VA_X.dll file version 10.9.2366.0 built 2020.02.20
DevEnv.exe version 16.4.29728.190 Professional


Bart

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - Apr 08 2020 :  11:31:28 AM  Show Profile  Reply with Quote
Have you disabled IDE intellisense on your machine? I am not seeing the underlining with IDE intellisense enabled, but when the IDE intellisense is enabled VA does not underline unknown symbols in C++ code. So enabling IDE intellisense may help, depending on why you turned it off in the first place.

We are aware that VA does not properly handle trailing return types, and are working on this:

case=86390

zen is the art of being at one with the two'ness
Go to Top of Page

bta
Ketchup Master

Belgium
57 Posts

Posted - Apr 09 2020 :  03:22:11 AM  Show Profile  Reply with Quote
Yes, we have disabled Intellisense as our projects are too big for it and it doesn't work correctly anyways.

If I have VAX turned off (and Intellisense as well), this is what is shown:





These are my Intellisense options:



Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - Apr 09 2020 :  05:29:02 AM  Show Profile  Reply with Quote
Thank you for the confirmation, the underlining is indeed coming from VA. If you want, you can turn this off by using the VA setting:

VA Options -> Underlining -> Underline unrecognized symbols using

hopefully we will have support for training return types fairly soon.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000