[PATCH] D58091: Customize warnings for missing built-in type
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 13 08:56:49 PST 2019
aaron.ballman added a comment.
In D58091#1396397 <https://reviews.llvm.org/D58091#1396397>, @jdoerfert wrote:
> In D58091#1396382 <https://reviews.llvm.org/D58091#1396382>, @aaron.ballman wrote:
>
> > - 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?
That's kind of what I was wondering, but I deal with builtins so infrequently that my expectations may be wrong here. If a user declares a builtin with a conflicting type outside of a header file, that seems like we'd want to warn the user about right? But this seems to remove that warning, at least in the case of test/Sema/implicit-builtin-decl.c:71. Or do I misunderstand the situation causing the warning to trigger?
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