Skip to content

M0-1-3: This rule doesn't consider constexpr variables used in template instantiations #349

Closed
@rak3-sh

Description

@rak3-sh

Affected rules

  • M0-1-3

Description

Constexpr variables which are used in template instantiations are not considered "used".

Example

template <int t>
class CharBuffer
{
  public:
  int member[t];
  CharBuffer():member{0}{}
};

int foo()
{
  constexpr int line_length = 1024U;
  CharBuffer<line_length> buffer{}; // line_length is used here but reported as a violation for M0-1-3
  return buffer.member[0];
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    false positive/false negativeAn issue related to observed false positives or false negatives.

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions