[libclang] Avoid crashing when getting layout info of an undeduced type.
authorEmilio Cobos Alvarez <emilio@crisal.io>
Tue, 26 Feb 2019 15:04:18 +0000 (15:04 +0000)
committerEmilio Cobos Alvarez <emilio@crisal.io>
Tue, 26 Feb 2019 15:04:18 +0000 (15:04 +0000)
commit0d76dc285c17c3e87994e46e4e0dc8383c755e4b
tree6df0b7408f9c6ba05a6594c1fd3c76994539fb04
parent582d46328ce644d791f4dce31b005fc260d33611
[libclang] Avoid crashing when getting layout info of an undeduced type.

When the type is not deducible, return an error instead of crashing.

This fixes https://bugs.llvm.org/show_bug.cgi?id=40813.

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

llvm-svn: 354885
clang/include/clang-c/Index.h
clang/test/Index/print-type-size.cpp
clang/tools/c-index-test/c-index-test.c
clang/tools/libclang/CXType.cpp