Skip to content

Primitive template arguments not evaluated when matching partial specialisation #1267

@davmac314

Description

@davmac314

Describe the bug
Non-literal primitive template arguments not evaluated when matching partial specialisation.

To Reproduce

template <typename T> constexpr bool consume_r1() { return true; }
template <class T1, bool EN = true> class A { };
template <class T1> class A <T1, (bool)consume_r1<T1>() > {
    constexpr static int val = 99;
};

A<int> a1; // should use specialisation

int f = a1.val; // error marked (incorrect!)

Expected behavior
The line marked with an error should not be marked, it has no error. The issue is that CDT does not use the partial specialisation of A which defines the val member, though it should.

Version Information (please complete the following information):

  • OS: Linux (N/A)
  • Eclipse Version: 2025-06 (4.36)
  • CDT Version: 12.1.0.202506041907

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