From: Chris Lattner Date: Fri, 13 Jul 2007 21:02:29 +0000 (+0000) Subject: Unspecified type specs default to int. This fixes a crash X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7a543ad55a38853c577f23b8524fa3de3290550e;p=clang Unspecified type specs default to int. This fixes a crash on test/Sema/implicit-int.c git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39833 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/Sema/SemaType.cpp b/Sema/SemaType.cpp index cdb767f58c..388359a753 100644 --- a/Sema/SemaType.cpp +++ b/Sema/SemaType.cpp @@ -37,6 +37,7 @@ static QualType ConvertDeclSpecToType(const DeclSpec &DS, ASTContext &Ctx) { "Unknown TSS value"); return Ctx.UnsignedCharTy; } + case DeclSpec::TST_unspecified: // Unspecific typespec defaults to int. case DeclSpec::TST_int: if (DS.getTypeSpecSign() != DeclSpec::TSS_unsigned) { switch (DS.getTypeSpecWidth()) { diff --git a/test/Sema/implicit-int.c b/test/Sema/implicit-int.c new file mode 100644 index 0000000000..e4a215fb78 --- /dev/null +++ b/test/Sema/implicit-int.c @@ -0,0 +1,4 @@ +// RUN: clang -fsyntax-only %s + +foo() { +}