[PATCH] D122278: [clang] Improve diagnostic for reopened inline namespace
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 23 05:23:09 PDT 2022
aaron.ballman added a comment.
Thank you for the fix! This LGTM with a minor nit, but please also add a release note for the fix.
================
Comment at: clang/lib/Sema/SemaDeclCXX.cpp:11062-11066
+ if (auto *FirstNS = PrevNS->getFirstDecl())
+ // 'inline' must appear on the original definition, but not necessarily
+ // on all extension definitions, so the note should point to the first
+ // definition to avoid confusion.
+ PrevNS = FirstNS;
----------------
There are no circumstances under which `getFirstDecl()` should return null, so I think this can be simplified.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D122278/new/
https://reviews.llvm.org/D122278
More information about the cfe-commits
mailing list