[Bug 25404] Fix crash on typedef in OpenCL 2.0
authorAnastasia Stulova <anastasia.stulova@arm.com>
Tue, 4 Apr 2017 16:50:46 +0000 (16:50 +0000)
committerAnastasia Stulova <anastasia.stulova@arm.com>
Tue, 4 Apr 2017 16:50:46 +0000 (16:50 +0000)
commit297908da5ba2195d92ce05701c0fe6e0d5edb19a
tree83f0d59dadf00d2a9d2dc57aca9a741284e98020
parent48596b6f7a422650987c7f2c2566917c7dfff61c
[Bug 25404] Fix crash on typedef in OpenCL 2.0

Fixed the assertion due to absence of source location for
implicitly defined types (using addImplicitTypedef()).
During Sema checks the source location is being expected
and therefore an assertion is triggered.

The change is not specific to OpenCL. But it is particularly
common for OpenCL types to be declared implicitly in Clang
to support the mode without the standard header.

Differential Revision: https://reviews.llvm.org/D31397

llvm-svn: 299447
clang/lib/Sema/SemaDecl.cpp
clang/test/SemaOpenCL/types.cl [new file with mode: 0644]