[PATCH] [Sema] Prevent crash while trying to merge types

Davide Italiano dccitaliano at gmail.com
Sat Apr 25 13:23:31 PDT 2015


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D9235

Files:
  cfe/trunk/lib/Sema/SemaDecl.cpp
  cfe/trunk/test/Sema/crash-invalid-builtin.c

Index: cfe/trunk/lib/Sema/SemaDecl.cpp
===================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp
+++ cfe/trunk/lib/Sema/SemaDecl.cpp
@@ -1749,7 +1749,7 @@
                                            Loc, Loc, II, R, /*TInfo=*/nullptr,
                                            SC_Extern,
                                            false,
-                                           /*hasPrototype=*/true);
+                                           R->isFunctionProtoType());
   New->setImplicit();
 
   // Create Decl objects for each parameter, adding them to the
Index: cfe/trunk/test/Sema/crash-invalid-builtin.c
===================================================================
--- cfe/trunk/test/Sema/crash-invalid-builtin.c
+++ cfe/trunk/test/Sema/crash-invalid-builtin.c
@@ -0,0 +1,4 @@
+// RUN: %clang_cc1 -triple=x86_64-apple-darwin -fsyntax-only -verify %s
+// PR23086
+
+__builtin_isinf(...); // expected-warning {{type specifier missing, defaults to 'int'}} expected-error {{ISO C requires a named parameter before '...'}} // expected-error {{conflicting types for '__builtin_isinf'}} // expected-note {{'__builtin_isinf' is a builtin with type 'int ()'}}

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D9235.24429.patch
Type: text/x-patch
Size: 1221 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150425/4ab2ce42/attachment.bin>


More information about the cfe-commits mailing list