On 7/22/19 12:34 PM, Martin Sebor wrote:
Ping: https://gcc.gnu.org/ml/gcc-patches/2019-07/msg00622.html

On 7/8/19 3:58 PM, Martin Sebor wrote:
The attached patch implements three new warnings:

  *  -Wstruct-not-pod triggers for struct definitions that are not
     POD structs,
  *  -Wclass-is-pod triggers for class definitions that satisfy
     the requirements on POD structs, and
  *  -Wmismatched-tags that triggers for class and struct declarations
     with class-key that doesn't match either their definition or
     the first declaration (if no definition is provided).

The implementation of -Wclass-is-pod and -Wstruct-not-pod is fairly
straightforward but the -Wmismatched-tags solution is slightly unusual.
It collects struct and class declarations first and diagnoses mismatches
only after the whole tramslation unit has been processed.  This is so
that the definition of a class can guide which declarations to diagnose
no matter which come first.

As Jonathan and I were saying in the connected discussion, the *pod warnings enforce questionable coding guidelines, so I'd rather not have them in the compiler.

-Wmismatched-tags is useful to have, given the MSVC/clang situation, but I wonder about memory consumption from all the record keeping. Do you have any overhead measurements?

Jason

Reply via email to