Marcel-Rodekamp / NSL

Nanosystem Simulation Library (NSL) implements statistical simulations for systems on the nanoscale
Other
2 stars 0 forks source link

Warnings with gcc 12.1 #77

Closed Marcel-Rodekamp closed 2 years ago

Marcel-Rodekamp commented 2 years ago

I updated my GCC version:

gcc --version
gcc (GCC) 12.1.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

and now I am getting warnings of the form:

warning: testing if a concept-id is a valid expression; add ‘requires’ to check satisfaction [-Wmissing-requires]
   66 |     isComplex<T> || std::is_floating_point_v<T> || std::is_integral_v<T>;
      |     ^
      |     requires

there appears to be an easy fix, adding a require statement in the problematic lines in concepts.hpp, we should apply it and check that clang can handle it.

Marcel-Rodekamp commented 2 years ago

This actually showed a bug in the concepts:

  1. isComplex was not evaluated as a function parenthesis was missing
  2. isDerived used to be the wrong order

The PR #88 fixes these things.