]> granicus.if.org Git - clang/commit
[C++17] Allow an empty expression in an if init statement
authorZhihao Yuan <zy@miator.net>
Sat, 17 Mar 2018 21:42:10 +0000 (21:42 +0000)
committerZhihao Yuan <zy@miator.net>
Sat, 17 Mar 2018 21:42:10 +0000 (21:42 +0000)
commitedde3116adc62d7074f2b5a74941624a7784fa31
treeccc5d5674fb9b66be8ab581c6e9f2a6e3b620d31
parent8ab822fdffe8472c052d90d9c1fbd23f8671dfbd
[C++17] Allow an empty expression in an if init statement

Summary:
This fixes [PR35381](https://llvm.org/pr35381) and an additional bug where clang didn't warn about the C++17 extension when having an expression in the init statement.

Thanks Nicolas Lesser for contributing the patch.

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: erik.pilkington, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D40445

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@327782 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Parse/ParseExprCXX.cpp
test/CXX/stmt.stmt/stmt.select/p3.cpp