Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 trailing return types support

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
bta Posted - Apr 08 2020 : 05:04:20 AM
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
3   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Apr 09 2020 : 05:29:02 AM
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.
bta Posted - Apr 09 2020 : 03:22:11 AM
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:



feline Posted - Apr 08 2020 : 11:31:28 AM
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

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000