http://llvm.org/bugs/show_bug.cgi?id=15390

            Bug ID: 15390
           Summary: default arguments should be allowed only in function
                    declaration
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

Clang accepts this code without a error.

void (*k(int a))(int b = 5);

According to standard:

[dcl.fct.default]p3 A default argument shall be specified only in the
parameter-declaration-clause of a function declaration or in a
template-parameter.
[dcl.dcl]p7 If the decl-specifier-seq contains no typedef specifier, the
declaration is called a function declaration if the type associated with the
name is a function type.

I'm not sure if this wording prohibits the code above. But I believe this
default argument is incorrect.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to