Skip to content

Non-conformant testing of template-template-args c++ standard feature #2783

Closed

Description

@mizvekov

This project includes workarounds for the changes introduced in https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0522r0.html, which was adopted as a defect report and thus retroactively applies back to all language standards.

See here:

#if defined(__GNUC__) && __GNUC__ > 6 && !defined(__clang__) && __cplusplus >= 201703L

The problem is that this workaround is testing for GCC specifically and C++17, excluding Clang.

GCC has included this change for a while, but it's only enabled by default in C++17 and above, but can be enabled and disabled freely with a flag as well.

Clang has never enabled it by default until now, deferring it to the flag only. This is changing with the next version, where it's going to be enabled in all language versions, and the flag becomes deprecated, to be removed in the version after that.

This means building this project is failing when this feature's enablement differs from default. With the next version of Clang, it's not going to work with the default there either.

Solution: replace above check with testing of standard feature macro: https://en.cppreference.com/w/cpp/feature_test#cpp_template_template_args

References:
llvm/llvm-project#89807
llvm/llvm-project#91504

Activity

  1. mizvekov commented on May 29, 2024

    @mizvekov
    Author

    There is another place that looks like a candidate for the same fix:

    #if defined(__GNUC__) && (__GNUC__ > 6)

    A user reported here that this also fixes a similar issue: llvm/llvm-project#89807 (comment)

  2. added a commit that references this issue on Jun 3, 2024
  3. JohanMabille commented on Mar 27, 2025

    @JohanMabille
    Member

    This has been fixed in #2833.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions