Question Details

No question body available.

Tags

c++ clang compiler-bug stdoptional

Answers (1)

January 12, 2026 Score: 5 Rep: 36,769 Quality: Low Completeness: 30%

The code is valid and so gcc and MSVC are correct.

Moreover - this seems to be a bug in clang 20.1 that was already fixed in clang 21.1.

See live demo.