Here's an example:
cout<<"Hello There "<<
cout<<"How are you?"<<endl;
Should not compile with gcc but does on Mac. What's even stranger is that if you removed the last << on the first line, the compiler does pick up on the problem of the lack of a semi-colon.
If you add a line of code in between those above lines, be it a declaration, assignment, if, or loop, then it will not compile.
Program runs normally with the error not picked up. If I went to Linux, it doesn't compile.
If you invoke a particular version of C++ on the command-line, then it does pick up that there is an error.
Could the issue be related to the MacOS' use of clang?
I'm trying to understand what the difference would be on a Mac/MacOS between the following two command-line invocations:
g++ -o derp derp.cpp - compiles, then when I run it, it does its thing correctly. g++ -std=c++20 -o derp derp.cpp - will not compile