- Notifications
You must be signed in to change notification settings - Fork 15.3k
Closed
Closed
Copy link
Labels
clang:bytecodeIssues for the clang bytecode constexpr interpreterIssues for the clang bytecode constexpr interpreter
Description
Minimal repro:
class A { public: static constexpr int get_value2() { return 1 + get_value(); } static constexpr int get_value() { return 1; } };<source>:3:26: error: constexpr function never produces a constant expression [-Winvalid-constexpr] 3 | static constexpr int get_value2() { return 1 + get_value(); } | ^~~~~~~~~~ <source>:3:52: note: undefined function 'get_value' cannot be used in a constant expression 3 | static constexpr int get_value2() { return 1 + get_value(); } | ^ <source>:4:26: note: declared here 4 | static constexpr int get_value() { return 1; } | ^ 1 error generated. Compiler returned: 1 https://godbolt.org/z/v7vsra1YG
Error disappears if I reorder methods.
Metadata
Metadata
Assignees
Labels
clang:bytecodeIssues for the clang bytecode constexpr interpreterIssues for the clang bytecode constexpr interpreter