folly/ExceptionWrapper.h: avoid warning about typeid operand side effects
authorJim Meyering <meyering@fb.com>
Fri, 13 Feb 2015 17:23:08 +0000 (09:23 -0800)
committerAlecs King <int@fb.com>
Tue, 3 Mar 2015 03:20:31 +0000 (19:20 -0800)
commita3259f635f9b2fb5a109672c0f16d4a497fa3b67
tree4c2aac30e3a8d3e3262106393db6da54a9f71df6
parentbb4612a0129615428e65400898cce618cd89eb1a
folly/ExceptionWrapper.h: avoid warning about typeid operand side effects

Summary:
* folly/ExceptionWrapper.h (class_name): Clang is not yet smart enough to
see that there is no harm in dereferencing an "item_" that we've just
verified is non-NULL.  Accommodate it, to avoid this:
./folly/ExceptionWrapper.h:199:30: error: expression with side effects will be evaluated despite being used as an operand to 'typeid' [-Werror,-Wpotentially-evaluated-expression]
return demangle(typeid(*item_));
^

Test Plan:
Run these commands and note there are fewer errors than before:
fbconfig --clang --with-project-version=clang:dev -r folly && fbmake dbgo

Reviewed By: mhorowitz@fb.com

Subscribers: trunkagent, yfeldblum, folly-diffs@

FB internal diff: D1848327

Tasks: 6244745

Signature: t1:1848327:1423869597:a58c9e9e3671befb78ae07fbd274a13d08ffb2a7

Blame Revision:
folly/ExceptionWrapper.h