# new version of If statement

**URL:** <https://discourse.llvm.org/t/new-version-of-if-statement/42970>\
**Category:** Clang Frontend\
**Created:** [October 29, 2016, 3:27pm UTC](https://discourse.llvm.org/t/new-version-of-if-statement/42970 "2016-10-29T15:27:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SHEKHAR\_BHANDAKKAR](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@SHEKHAR\_BHANDAKKAR](https://discourse.llvm.org/u/SHEKHAR_BHANDAKKAR)\
**Post date:** [October 29, 2016, 3:27pm UTC](https://discourse.llvm.org/t/new-version-of-if-statement/42970/1 "2016-10-29T15:27:31Z")

</div>

While using clang 3.8, I had a problem with the new version of the If statement which allows initialisation statement as follows:

``` if(init; condition) ```

I am getting a syntax error while using the new if statement.

Thanks,  
Shekhar

---

<div class="post-metadata">

**Author:** ![pepsiman](https://sea1.discourse-cdn.com/flex021/user_avatar/discourse.llvm.org/pepsiman/32/20807_2.png) [@pepsiman](https://discourse.llvm.org/u/pepsiman)\
**Post date:** [October 29, 2016, 3:38pm UTC](https://discourse.llvm.org/t/new-version-of-if-statement/42970/2 "2016-10-29T15:38:22Z")

</div>

[http://clang.llvm.org/cxx\_status.html](http://clang.llvm.org/cxx_status.html) says that "Separate variable and  
condition for if and switch" needs Clang 3.9.
