Compiler Warning (level 4) C5266
'const' qualifier on return type has no effect
The C++ Standard specifies that a top-level const (or volatile) qualification on a function return type is ignored.
This warning is off by default.
This warning was introduced in Visual Studio 17.6
Example
The following sample generates C5266:
// compile with: /W4 /c
#pragma warning(default : 5266) // enable warning C5266 because it's off by default (or compile with /w45266)
const int f() // warning C5266: 'const' qualifier on return type has no effect
{
return 13;
}
See also
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for