Compiler Error C3551
if a trailing return type is used then the leading return type shall be the single type-specifier 'auto' (not 'type')
The leading return type in trailing return type syntax must contain only auto
.
// C3551.cpp
// compile with: /c
const auto func1() -> const int; // C3551
auto* func2() -> int*; // C3551
auto& func3() -> int&; // C3551
auto&& func4() -> int&&; // C3551
decltype(auto) func5() -> int; // C3551
auto func6() -> int; // OK
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