[PATCH] D31397: [Bug 25404] Fix crash on typedef in OpenCL 2.0
Anastasia Stulova via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 28 04:46:52 PDT 2017
Anastasia added inline comments.
================
Comment at: lib/Sema/SemaDecl.cpp:2157
if (getDiagnostics().getSuppressSystemWarnings() &&
- (Context.getSourceManager().isInSystemHeader(Old->getLocation()) ||
+ // Some standard types are defined implicitly in Clang (e.g. OpenCL).
+ (Old->isImplicit() || New->isImplicit() ||
----------------
ahatanak wrote:
> Is it necessary to check whether New is implicit? I was just wondering when or how an implicit definition would redefine a typedef.
I had a thought on it too, and I am not sure actually. This can happen if we implicitly define something from the standard headers. But I believe the Sema initialization should always happen before parsing the standard header or even loading them from the PCH. So I guess this shouldn't ever happen really? Perhaps, I should just remove this?
https://reviews.llvm.org/D31397
More information about the cfe-commits
mailing list