Overview: An if-with-initializer with an empty init-statement followed by a semicolon is valid in C++17, but rejected by clang (trunk). Steps to reproduce: Compile this code: int main() { if (; true); } Actual Results: The following errors are shown: 3 : <source>:3:6: error: expected expression if (; true); ^ 3 : <source>:3:12: error: extraneous ')' before ';' if (; true); ^ Expected results: The code should compile. Additional information: According to the C++17 grammar, the init-statement in an if-with-initializer is allowed to be an empty expression followed by a semicolon. GCC 7.2 and MSVC 19 2017 both accept this code.
This was fixed some time ago, thanks! :)