Pull request 1081 in include-what-you-use: [clang compat] Harden handling of 'final' specifier

0 views
Skip to first unread message

notifi...@include-what-you-use.org

unread,
Jul 13, 2022, 3:12:17 PM7/13/22
to include-wh...@googlegroups.com
New pull request 1081 by kimgr: [clang compat] Harden handling of 'final' specifier
https://github.com/include-what-you-use/include-what-you-use/pull/1081

Clang 9f57b65a272817752aa00e2fb94154e6eed1d0ec sometimes prints the 'final'
keyword twice for a declaration (tracking bug:
https://github.com/llvm/llvm-project/issues/56517).

This triggered several bugs in MungedForwardDeclareLineForTemplates:

* Only removed first 'final'
* Removed one character too many (sizeof(char[]) includes the trailing NUL)

Instead, replace all occurrences of 'final' and do it first so the stripping of
superclasses and body also get rid of trailing spaces. This should now work even
if the upstream bug is fixed.


Reply all
Reply to author
Forward
0 new messages