On Fri, Jan 6, 2017 at 3:14 PM, Jim Apple <[email protected]> wrote:
> > todd@todd-ThinkPad-T540p:/tmp$ g++ --version ; g++ -o test test.cc
> > g++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
> >
> > test.cc:2:1: warning: ‘warn_unused_result’ attribute only applies to
> > function types [-Wattributes]
> > Foo {
> > ^
>
> This seems like a warning stating that it doesn't work.
>
Oh, woops. Read it too fast :)
Well, at least it works with Clang, so could always make a macro which
expands to nothing in G++ and the attribute for Clang. Assuming you run can
run a precommit with Clang as the compiler, that should still be good
enough I'd think.
-Todd
--
Todd Lipcon
Software Engineer, Cloudera