[Sema] Diagnose more cases of static data members in local or unnamed classes
We currently diagnose static data members directly contained in unnamed classes, but we should also diagnose when they're in a class that is nested (directly or indirectly) in an unnamed class. Do this by iterating up the list of parent DeclContexts and checking if any is an unnamed class. Similarly also check for function or method DeclContexts (which includes things like blocks and openmp captured statements) as then the class is considered to be a local class, which means static data members aren't allowed. Differential Revision: https://reviews.llvm.org/D80295
Loading
Please sign in to comment