non static function calls from static functions are not flagged as errors

For the below example

class AAA
{
static void StaticFunc();
void NonStaticFunc();
};

void AAA::StaticFunc()
{
NonStaticFunc();
}

void AAA::NonStaticFunc()
{
}

msvc141u8 signals an error:

"error C2352: 'AAA::NonStaticFunc': illegal call of non-static member function"

 

while ReSharper C++ at version:

JetBrains ReSharper Ultimate 2018.3.1 Build 183.0.20181225.200351
ReSharper C++ 2018.3.20181226.120920

is fine with it.

I am using:

"Microsoft Visual Studio Professional 2017
Version 15.3.1
VisualStudio.15.Release/15.3.1+26730.8"

with Configuration Type = Makefile

 

Is this a known problem?

1 comment
Comment actions Permalink

Hello!

This is a bug - it looks like R++ does not show this error in out-of-class member functions. I've filed https://youtrack.jetbrains.com/issue/RSCPP-26302.

Thanks for the feedback!

0

Please sign in to leave a comment.