Skip to content

Clang fails to warn about deprecated volatile-qualified return type #133380

@siya100

Description

@siya100

Code :

volatile struct amber jurassic();  // Should warn (deprecated) — Clang misses this
void trex(volatile short left_arm, volatile short right_arm);  // Clang warns (correct)
void fly(volatile struct pterosaur* pteranodon);  // OK (no warning expected)

Expected Behavior:
Clang should emit a deprecation warning (-Wvolatile or similar) for the volatile return type in jurassic(), just as GCC does

Actual Behavior:
Clang only warns about volatile parameters (e.g., trex) but silently accepts the deprecated volatile return type.

https://godbolt.org/z/ajs7n8P7h

Metadata

Metadata

Assignees

Labels

clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerconfirmedVerified by a second party

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions