Skip to content

Build error with clang-19 #3124

@veblush

Description

@veblush

Describe your environment

Build HEAD with clang-19

Steps to reproduce

Using the environment having clang-19 such as the docker image, silkeh/clang:19, build opentelemetry-cpp with cmake.

What is the expected behavior?

Built succesfully.

What is the actual behavior?

Clang 19 throws compilation errors as follows

opentelemetry-cpp/api/include/opentelemetry/logs/logger_type_traits.h:164:69: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
  164 |     return LogRecordSetterTrait::template Set(
      |                                                                     ^

opentelemetry-cpp/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::type>::template Set(
      |                                                                                         ^

opentelemetry-cpp/api/include/opentelemetry/logs/event_logger.h:73:89: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
   73 |         detail::LogRecordSetterTrait::type>::template Set(
      |                                                                                         ^

Additional context

Clang-18 is able to build it so this is a new issue from clang-19. llvm/llvm-project#94194 is the reference point about this issue. Note that missing-template-arg-list-after-template-kw is treated as an error by default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions