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: unassignedclangb...@nondot.org
          Reporter: eugvelesev...@gmail.com
                CC: llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to