https://github.com/qinkunbao created https://github.com/llvm/llvm-project/pull/142700
None >From e234d999848d00cafa7878f988110e61663eb645 Mon Sep 17 00:00:00 2001 From: Qinkun Bao <qin...@google.com> Date: Wed, 4 Jun 2025 00:08:04 +0000 Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?= =?UTF-8?q?l=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Created using spr 1.3.6 --- clang/include/clang/Basic/DiagnosticGroups.td | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/clang/include/clang/Basic/DiagnosticGroups.td b/clang/include/clang/Basic/DiagnosticGroups.td index be75b9ee6e3f6..beda73e675fc6 100644 --- a/clang/include/clang/Basic/DiagnosticGroups.td +++ b/clang/include/clang/Basic/DiagnosticGroups.td @@ -813,19 +813,19 @@ changes to one object won't affect the others, the object's initializer will run once per copy, etc. Specifically, this warning fires when it detects an object which: - 1. Is defined as ``inline`` in a header file (so it might get compiled into multiple libaries), and - 2. Has external linkage (otherwise it's supposed to be duplicated), and - 3. Has hidden visibility. +1. Is defined as ``inline`` in a header file (so it might get compiled into multiple libaries), and +2. Has external linkage (otherwise it's supposed to be duplicated), and +3. Has hidden visibility. As well as one of the following: - 1. The object is mutable, or - 2. The object's initializer definitely has side effects. +1. The object is mutable, or +2. The object's initializer definitely has side effects. The warning can be resolved by removing one of the conditions above. In rough order of preference, this may be done by: - 1. Marking the object ``const`` (if possible) - 2. Moving the object's definition to a source file - 3. Giving the object non-hidden visibility, e.g. using ``__attribute((visibility("default")))``. +1. Marking the object ``const`` (if possible) +2. Moving the object's definition to a source file +3. Giving the object non-hidden visibility, e.g. using ``__attribute((visibility("default")))``. Note that for (2), all levels of a pointer variable must be constant; ``const int*`` will trigger the warning because the pointer itself is mutable. _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits