scons: fix hook for 'deprecated' attribute
scons: fix hook for 'deprecated' attribute

On the new release, the compilation is polluted by the same warning:
    > ''deprecated' attribute directive ignored

It seems that the hook added in this patch does not work:
https://gem5-review.googlesource.com/c/public/gem5/+/45246/1..7

The snippet of code compile with TryCompile on g++{8,9}.
It probably comes from the fact that the compilation
only creates a warning and not an error.

By adding temporarily '-Werror' for this compilation test,
it filters the faulty gcc versions.

Change-Id: I2b8b7a1a7e06df437b76e98d212947f4f9452311
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/48843
Reviewed-by: Gabe Black <d3e8afea784ab4a50a2dbf9149d2eaa8478e1cbc@gmail.com>
Maintainer: Gabe Black <d3e8afea784ab4a50a2dbf9149d2eaa8478e1cbc@gmail.com>
Tested-by: kokoro <2ac7b1f3fa578934c95181d4272be0d3bca00121@google.com>
(cherry picked from commit a366e66272b7c4b01037d68a7723922b49f506cd)
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50028
Maintainer: Bobby R. Bruce <b9dba908ffb6c6d8ffe449cc88b3709c13c485c2@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <92de577f37050ad05b60626d2f17913f40dcb1a2@gmail.com>
Reviewed-by: Daniel Carvalho <91779fc734d358d9575ec4910de29bfcbcaf1b22@yahoo.com.br>

gem5/gem5,gem5/gem5,gem5/gem5,gem5/gem5,gem5/gem5,gem5/gem5,gem5/gem5