Adjust error_reporting to allow deprecation messages for 3.0
minor #12705 Adjust error_reporting to allow deprecation messages for 3.0 (davidfuhr)

This PR was merged into the 2.7 branch.

Discussion
----------

Adjust error_reporting to allow deprecation messages for 3.0

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | #12623
| License       | MIT
| Doc PR        |

Commits
-------

11ba901 Adjust error_reporting to allow deprecation messages for 3.0