]> granicus.if.org Git - clang/commit
[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)
commitfa3d6e13f61c776b20884abfd18cab236d398684
tree9ff9ff8ae1bafd0b5a4f649cee97b54d005afbd4
parenta463701ed2c3612812c34c1057a6dbdf1fdb8224
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299447 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaDecl.cpp
test/SemaOpenCL/types.cl [new file with mode: 0644]