]> granicus.if.org Git - clang/commitdiff
Unspecified type specs default to int. This fixes a crash
authorChris Lattner <sabre@nondot.org>
Fri, 13 Jul 2007 21:02:29 +0000 (21:02 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 13 Jul 2007 21:02:29 +0000 (21:02 +0000)
on test/Sema/implicit-int.c

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39833 91177308-0d34-0410-b5e6-96231b3b80d8

Sema/SemaType.cpp
test/Sema/implicit-int.c [new file with mode: 0644]

index cdb767f58c7933643a97f756dd8431c08ef53711..388359a7530130461027cc2d53cb04be32ab222f 100644 (file)
@@ -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 (file)
index 0000000..e4a215f
--- /dev/null
@@ -0,0 +1,4 @@
+// RUN: clang -fsyntax-only %s
+
+foo() {
+}