You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 :
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.
The text was updated successfully, but these errors were encountered:
Extended Description
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 :
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.
The text was updated successfully, but these errors were encountered: