[Sema] Fix -Wcomma for C89
authorRichard Trieu <rtrieu@google.com>
Thu, 25 Oct 2018 01:08:00 +0000 (01:08 +0000)
committerRichard Trieu <rtrieu@google.com>
Thu, 25 Oct 2018 01:08:00 +0000 (01:08 +0000)
commitf371380fc96c67cab15067dea51a55131757d351
tree5d057a41ba8deefc448a4c36f5790bc1b8434fc5
parenta6c6698217d7e20fd5564377d5ba2ab6b3c6f768
[Sema] Fix -Wcomma for C89

There is a small difference in the scope flags for C89 versus the other C/C++
dialects.  This change ensures that the -Wcomma warning won't be duplicated or
issued in the wrong location.  Also, the test case is refactored into C and C++
parts, with the C++ parts guarded by a #ifdef to allow the test to run in both
modes.

https://bugs.llvm.org/show_bug.cgi?id=32370

llvm-svn: 345228
clang/lib/Sema/SemaExpr.cpp
clang/lib/Sema/SemaStmt.cpp
clang/test/SemaCXX/warn-comma-operator.cpp