[PATCH] D58091: Customize warnings for missing built-in type

Johannes Doerfert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 13 08:26:10 PST 2019


jdoerfert added a comment.

In D58091#1396382 <https://reviews.llvm.org/D58091#1396382>, @aaron.ballman wrote:

> If I'm following along properly, it sounds like we want to disable this warning largely because it can appear in header files attempting to declare the functions in question.


That is the situation that exposed the problem, yes.

> - but I wonder why those diagnostics are happening in the first place. It seems like the warning is still useful when it triggers outside of that situation, no?

The underlying conceptual problem, which I didn't know when I added `GE_Missing_type`, is that this has _nothing_ to do with the location of the declaration. We say, include the header X.h, if we were not able to build a type for recognized built-in Y that should be declared in X.h. However, we should report _why_ we could not build the type instead. For built-ins we do not have a type on record (`GE_Missing_type`), this is always, so no warning for now. For the ones that we only fail to build a type because some requirement is missing, we should report that, at least when we are in the respective header. I don't have a perfect solution of what to do actually.

I could check if the declaration is (probably) in the respective header so we can switch between warnings?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D58091





More information about the cfe-commits mailing list