================ @@ -5585,6 +5585,18 @@ SourceRange EnumConstantDecl::getSourceRange() const { return SourceRange(getLocation(), End); } +bool EnumConstantDecl::isOutOfLine() const { + if (Decl::isOutOfLine()) + return true; + + // In C++, if the enumeration is out of line, the enumeration constants are + // also out of line. + if (getLangOpts().CPlusPlus) ---------------- AaronBallman wrote:
Agreed that C has no way to spell this and from my looking, it seems like every place which calls `isOutOfLine()` is a C++-specific code path, but many times it seems to be accidental. For example, we have several uses that are guarded on whether something is a static data member, which is a C++-only concept, rather than guarding on C++ itself. As C integrates more C++ features, I worry that we'll end up calling this in C code as well, so that's a defensive measure. It technically can be removed, but I'm not certain we want to remove it, WDYT? https://github.com/llvm/llvm-project/pull/134998 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits