Skip to content

Clang reporting multiple consteval usage violations, violations do not appear to be violations? #55601

Closed
root-project/root
#13700
@mattreecebentley

Description

@mattreecebentley

Clang is reporting consteval usage violations with the attached version of plf::hive and it's test suite.
I've removed the consteval statements in the plf::hive repo for the moment so that clang can be used.
Output via godbolt here.

Primarily it appears to be objecting to the use of consteval functions in
(a) class constructor member initialization ("cannot take address of consteval function 'default_min_block_capacity' outside of an immediate invocation")
(b) class constructor member initialization default values ("call to consteval function 'plf::hive::default_block_capacity_limits' is not a constant expression")
(c) in assignment to constexpr variables ("call to consteval function 'plf::hive::block_capacity_hard_limits' is not a constant expression")

GCC11 and MSVC 2022 do not see these bugs. If they are bugs on my end, I would like to understand them, as the function return values are always computable at compile-time
plf_hive_prev_version.zip
.

Metadata

Metadata

Assignees

Labels

c++20clang:frontendLanguage frontend issues, e.g. anything involving "Sema"confirmedVerified by a second partyconstevalC++20 consteval

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions