microsoft / wil

Windows Implementation Library
MIT License
2.57k stars 234 forks source link

Fix incorrect placement of WI_NODISCARD #455

Closed tylerretzlaff closed 1 month ago

tylerretzlaff commented 1 month ago

For inline functions WI_NODISCARD needs to be placed before inline not after. While cl permits non-conformant placement clang++ does not resulting in error G35162013: 'nodiscard' attribute cannot be applied to types [clang-diagnostic-error]

Move WI_NODISCARD before inline to correct the problem.