mirror of
https://github.com/intel/llvm.git
synced 2026-01-23 16:06:39 +08:00
[clangd] Fix an inlay-hint crash on a null deduced type.
This commit is contained in:
@@ -671,7 +671,8 @@ private:
|
||||
if (QT->isDecltypeType())
|
||||
return true;
|
||||
if (const AutoType *AT = QT->getContainedAutoType())
|
||||
if (AT->getDeducedType()->isDecltypeType())
|
||||
if (!AT->getDeducedType().isNull() &&
|
||||
AT->getDeducedType()->isDecltypeType())
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1378,11 +1378,16 @@ TEST(TypeHints, Decltype) {
|
||||
using G = Foo<$g[[decltype(0)]], float>;
|
||||
|
||||
auto $h[[h]] = $i[[decltype(0)]]{};
|
||||
|
||||
// No crash
|
||||
/* error-ok */
|
||||
auto $j[[s]];
|
||||
)cpp",
|
||||
ExpectedHint{": int", "a"}, ExpectedHint{": int", "b"},
|
||||
ExpectedHint{": int", "c"}, ExpectedHint{": int", "e"},
|
||||
ExpectedHint{": int", "f"}, ExpectedHint{": int", "g"},
|
||||
ExpectedHint{": int", "h"}, ExpectedHint{": int", "i"});
|
||||
ExpectedHint{": int", "h"}, ExpectedHint{": int", "i"},
|
||||
ExpectedHint{": auto", "j"});
|
||||
}
|
||||
|
||||
TEST(DesignatorHints, Basic) {
|
||||
|
||||
Reference in New Issue
Block a user