ament / ament/ament_lint

[ament_cpplint] does not handle constexpr-if statements properly

Offen
#311 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug help wanted
Vorherrschende Sprache
Python
Sterne
50
Forks
129
Ø Merge
3 T. 10 Std.
Gemergte PRs (30 T.)
3

Beschreibung

On code like this:

```cpp
if constexpr (std::is_same_v) {
callback(*message);
} else if constexpr (std::is_same_v) {
callback(*message, message_info);
} else if constexpr (std::is_same_v) {
callback(create_unique_ptr_from_shared_ptr_message(message));
} else if constexpr (std::is_same_v) {
callback(create_unique_ptr_from_shared_ptr_message(message), message_info);
} else if constexpr (
std::is_same_v||
std::is_same_v||
std::is_same_v)
{
callback(message);
} else if constexpr (
std::is_same_v||
std::is_same_v||
std::is_same_v)
{
callback(message, message_info);
}
```

I get cpplint errors like `If an else has a brace on one side, it should have it on both [readability/braces] [5]`. It seems like it doesn't understand the `constexpr-if`, but maybe it's something else. I think it's a bug though.

Maybe the upstream version of `cpplint` has addressed this?

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.