Re:Apple's classic Pascal poster, remade as a vector image [...
by Voultapher on Friday January 05, 2024 @08:56AM
(#38879060)
IIRC because of some newer constexpr features you need a C++ VM with UB detection to parse C++, pretty wild. One of the reasons you have the choice between clang based source analysis tooling and incorrect tooling.
Re:Apple's classic Pascal poster, remade as a vector image [...
by eru on Saturday January 06, 2024 @03:33AM
(#38889669)
It's not so much that clang is correct: there's no way to implement correct C++ according to the standard. But if you are using clang as your compiler, at least your tooling will agree with your compiler.
Deciding on syntax is Turing complete in C++. (Even in Pascal, you still need to check that you only used identifiers you declared before. That's not expressed in this diagram. But the extra rules required to get to the full language's syntax are fairly tame compared to C++.)
Syntax is Turing complete, and hence undecidable, in C++, because what's valid syntax depends on types in some instances, and the type system is Turing complete.
See eg https://medium.com/@mujjingun_23509/full-proof-that-c-gramma... or https://stackoverflow.com/questions/794015/what-do-people-me...