You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by sw...@apache.org on 2025/07/02 03:13:32 UTC
(logging-log4cxx) branch silence_sonarcloud_warning created (now 3b2cdc5b)
This is an automated email from the ASF dual-hosted git repository.
swebb2066 pushed a change to branch silence_sonarcloud_warning
in repository https://gitbox.apache.org/repos/asf/logging-log4cxx.git
at 3b2cdc5b Prevent SonarCloud warning
This branch includes the following new commits:
new 3b2cdc5b Prevent SonarCloud warning
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(logging-log4cxx) 01/01: Prevent SonarCloud warning
Posted by sw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
swebb2066 pushed a commit to branch silence_sonarcloud_warning
in repository https://gitbox.apache.org/repos/asf/logging-log4cxx.git
commit 3b2cdc5bf6b0780609c39770c35e027fb3af98f9
Author: Stephen Webb <sw...@gmail.com>
AuthorDate: Wed Jul 2 13:13:11 2025 +1000
Prevent SonarCloud warning
---
.github/workflows/sonarcloud.yml | 6 +++---
src/main/include/log4cxx/helpers/singletonholder.h | 10 ++++++----
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml
index afe89b75..535fce09 100644
--- a/.github/workflows/sonarcloud.yml
+++ b/.github/workflows/sonarcloud.yml
@@ -18,8 +18,8 @@ on:
push:
branches:
- master
-# pull_request:
-# types: [opened, synchronize, reopened]
+ pull_request:
+ types: [opened, synchronize, reopened]
jobs:
build:
@@ -94,6 +94,6 @@ jobs:
# Consult https://docs.sonarsource.com/sonarqube-server/latest/analyzing-source-code/scanners/sonarscanner/ for more information and options
args: >
--define sonar.host.url="${{ env.SONAR_SERVER_URL }}"
- --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}"
+ --define sonar.cfamily.compile-commands="${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json"
--define sonar.coverageReportPaths=build/coverage.xml
diff --git a/src/main/include/log4cxx/helpers/singletonholder.h b/src/main/include/log4cxx/helpers/singletonholder.h
index e8b8ef23..2fefa8f1 100644
--- a/src/main/include/log4cxx/helpers/singletonholder.h
+++ b/src/main/include/log4cxx/helpers/singletonholder.h
@@ -44,13 +44,15 @@ public: // Object method stubs
public: // ...structors
SingletonHolder() {}
- template <typename ... Args>
+ template <typename ... Args
+ , typename = std::enable_if_t<!std::is_same_v<std::decay_t<T>, SingletonHolder>>
+ >
SingletonHolder(Args&& ... args)
: m_data(std::forward<Args>(args) ... )
{}
- // Prevent copying
- SingletonHolder(const SingletonHolder&) = delete;
- SingletonHolder(SingletonHolder&&) = delete;
+ // Prevent copying
+ SingletonHolder(const SingletonHolder&) = delete;
+ SingletonHolder(SingletonHolder&&) = delete;
public: // Accessors
T& value() { return m_data; }