-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[clang] Warn about deprecated volatile-qualified return types #137899
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -231,6 +231,13 @@ namespace DeprecatedVolatile { | |
a = c = a; | ||
b += a; | ||
} | ||
|
||
volatile struct amber jurassic(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As I can see, if the return type is not a struct/class, the warning is issued. Could you please add a test case with volatile qualifier applied to a basic type (for example int) and make sure there is no double diagnostic issued now? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lines 207-215 are that, are they not? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, these are what I meant. Thanks! |
||
// cxx20-warning@-1 {{volatile-qualified return type 'volatile struct amber' is deprecated}} | ||
void trex(volatile short left_arm, volatile struct amber right_arm); | ||
// cxx20-warning@-1 {{volatile-qualified parameter type 'volatile short' is deprecated}} | ||
// cxx20-warning@-2 {{volatile-qualified parameter type 'volatile struct amber' is deprecated}} | ||
void fly(volatile struct pterosaur* pteranodon); | ||
} | ||
|
||
namespace ArithConv { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see there is another place that issues
warn_deprecated_volatile_return
inSema::CheckFunctionReturnType
. I wonder why doesn't it suffice?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand that
CheckFunctionReturnType
is used when checking the type of a function likeusing T = volatile int();
but this codepath here is used when checking a function declaration instead.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, thanks for clarifying