Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Sep 2024 17:46:40 GMT
From:      Dimitry Andric <dim@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 676864fd474b - main - devel/opentelemetry-cpp: fix build with clang 19
Message-ID:  <202409081746.488HkeSl025898@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by dim:

URL: https://cgit.FreeBSD.org/ports/commit/?id=676864fd474bdd6ec1d74496d0a58d9a5a046601

commit 676864fd474bdd6ec1d74496d0a58d9a5a046601
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-09-08 09:20:21 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-09-08 17:45:19 +0000

    devel/opentelemetry-cpp: fix build with clang 19
    
    Clang 19 now implements CWG 96 [1], which requires a template argument
    list after a 'template' keyword, resulting in errors similar to:
    
        /wrkdirs/usr/ports/devel/opentelemetry-cpp/work/opentelemetry-cpp-1.16.1/api/include/opentelemetry/logs/logger_type_traits.h:169:69: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
          169 |     return LogRecordSetterTrait<common::KeyValueIterable>::template Set(
              |                                                                     ^
        /wrkdirs/usr/ports/devel/opentelemetry-cpp/work/opentelemetry-cpp-1.16.1/api/include/opentelemetry/logs/logger.h:76:89: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
           76 |         detail::LogRecordSetterTrait<typename std::decay<ArgumentType>::type>::template Set(
              |                                                                                         ^
        /wrkdirs/usr/ports/devel/opentelemetry-cpp/work/opentelemetry-cpp-1.16.1/api/include/opentelemetry/logs/event_logger.h:69:89: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
           69 |         detail::LogRecordSetterTrait<typename std::decay<ArgumentType>::type>::template Set(
              |                                                                                         ^
    
    In these cases, appending "<>" is enough to satisfy the constraint.
    
    PR:             281359
    Approved by:    osa (maintainer)
    MFH:            2024Q3
---
 .../patch-api_include_opentelemetry_logs_event__logger.h      | 11 +++++++++++
 .../files/patch-api_include_opentelemetry_logs_logger.h       | 11 +++++++++++
 ...atch-api_include_opentelemetry_logs_logger__type__traits.h | 11 +++++++++++
 3 files changed, 33 insertions(+)

diff --git a/devel/opentelemetry-cpp/files/patch-api_include_opentelemetry_logs_event__logger.h b/devel/opentelemetry-cpp/files/patch-api_include_opentelemetry_logs_event__logger.h
new file mode 100644
index 000000000000..332f955f1bdf
--- /dev/null
+++ b/devel/opentelemetry-cpp/files/patch-api_include_opentelemetry_logs_event__logger.h
@@ -0,0 +1,11 @@
+--- api/include/opentelemetry/logs/event_logger.h.orig	2024-07-17 20:04:10 UTC
++++ api/include/opentelemetry/logs/event_logger.h
+@@ -66,7 +66,7 @@ class EventLogger (public)
+     nostd::unique_ptr<LogRecord> log_record = delegate_logger->CreateLogRecord();
+ 
+     IgnoreTraitResult(
+-        detail::LogRecordSetterTrait<typename std::decay<ArgumentType>::type>::template Set(
++        detail::LogRecordSetterTrait<typename std::decay<ArgumentType>::type>::template Set<>(
+             log_record.get(), std::forward<ArgumentType>(args))...);
+ 
+     EmitEvent(event_name, std::move(log_record));
diff --git a/devel/opentelemetry-cpp/files/patch-api_include_opentelemetry_logs_logger.h b/devel/opentelemetry-cpp/files/patch-api_include_opentelemetry_logs_logger.h
new file mode 100644
index 000000000000..dc1c2541b51e
--- /dev/null
+++ b/devel/opentelemetry-cpp/files/patch-api_include_opentelemetry_logs_logger.h
@@ -0,0 +1,11 @@
+--- api/include/opentelemetry/logs/logger.h.orig	2024-07-17 20:04:10 UTC
++++ api/include/opentelemetry/logs/logger.h
+@@ -73,7 +73,7 @@ class Logger (public)
+     }
+ 
+     IgnoreTraitResult(
+-        detail::LogRecordSetterTrait<typename std::decay<ArgumentType>::type>::template Set(
++        detail::LogRecordSetterTrait<typename std::decay<ArgumentType>::type>::template Set<>(
+             log_record.get(), std::forward<ArgumentType>(args))...);
+ 
+     EmitLogRecord(std::move(log_record));
diff --git a/devel/opentelemetry-cpp/files/patch-api_include_opentelemetry_logs_logger__type__traits.h b/devel/opentelemetry-cpp/files/patch-api_include_opentelemetry_logs_logger__type__traits.h
new file mode 100644
index 000000000000..46d4327274a5
--- /dev/null
+++ b/devel/opentelemetry-cpp/files/patch-api_include_opentelemetry_logs_logger__type__traits.h
@@ -0,0 +1,11 @@
+--- api/include/opentelemetry/logs/logger_type_traits.h.orig	2024-07-17 20:04:10 UTC
++++ api/include/opentelemetry/logs/logger_type_traits.h
+@@ -166,7 +166,7 @@ struct LogRecordSetterTrait
+                 * = nullptr>
+   inline static LogRecord *Set(LogRecord *log_record, ArgumentType &&arg) noexcept
+   {
+-    return LogRecordSetterTrait<common::KeyValueIterable>::template Set(
++    return LogRecordSetterTrait<common::KeyValueIterable>::template Set<>(
+         log_record, std::forward<ArgumentType>(arg));
+   }
+ 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202409081746.488HkeSl025898>