OSDN Git Service

Do not warn that an expression of the form (void)arr; is unused when
authorRichard Smith <richard@metafoo.co.uk>
Thu, 28 May 2020 00:20:15 +0000 (17:20 -0700)
committerRichard Smith <richard@metafoo.co.uk>
Thu, 28 May 2020 00:26:29 +0000 (17:26 -0700)
commit00e5d38d40162d049f67b436ad42c9d05092e65c
tree62945eb67493a1a3e1cb940f1bbbd770b077726f
parentc94c5bf9cce8a4c7ad5e8abbc8f21bad5cf6b889
Do not warn that an expression of the form (void)arr; is unused when
arr is a volatile non-local array.

This fixes a recent regression exposed by removing lvalue-to-rvalue
conversion of discarded volatile arrays. In passing, regularize the
rules we use to determine whether '(void)expr;' warns when expr is a
volatile glvalue.
clang/include/clang/AST/Expr.h
clang/lib/AST/Expr.cpp
clang/lib/Sema/SemaExprCXX.cpp
clang/test/SemaCXX/warn-unused-value.cpp