[llvm-bugs] [Bug 31020] New: Attributed K&R function definition doesn't merge with a prototyped declaration

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Nov 15 03:56:22 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=31020

            Bug ID: 31020
           Summary: Attributed K&R function definition doesn't merge with
                    a prototyped declaration
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: eugvelesevich at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 17590
  --> https://llvm.org/bugs/attachment.cgi?id=17590&action=edit
test

Look at the test:
_Bool K&R parameter is promoted to int but clang considers the K&R function as
prototyped one because of the attribute.

SemaDecl.cpp CreateNewFunctionDecl:
bool HasPrototype =
  (D.isFunctionDeclarator() && D.getFunctionTypeInfo().hasPrototype) ||
  (!isa<FunctionType>(R.getTypePtr()) && R->isFunctionProtoType());

So isa<FunctionType>(R.getTypePtr()) is false because R.getTypePtr() is
AttributedType.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20161115/df4c7417/attachment.html>


More information about the llvm-bugs mailing list