[PATCH] D98548: [clang][Sema] Don't try to initialize implicit variable of invalid anonymous union/struct

Tomas Matheson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 15 02:55:43 PDT 2021


tmatheson added a comment.

This seems quite an early point to bail out, so it will prevent some errors/warnings associated with initialization from being emitted. For example, this warning is currently emitted but would be suppressed by this patch:

  union {
    virtual int a();
    int b = 'c'; // expected-warning {{in-class initialization of non-static data member is a C++11 extension [-Wc++11-extensions]}}
  }

I don't know how much that matters seeing as the union is invalid by this point.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98548/new/

https://reviews.llvm.org/D98548



More information about the cfe-commits mailing list