[LLVMbugs] [Bug 19496] New: [modules] should probably not diagnose conflict between unimported default argument and new default argument
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Sun Apr 20 13:35:04 PDT 2014
http://llvm.org/bugs/show_bug.cgi?id=19496
Bug ID: 19496
Summary: [modules] should probably not diagnose conflict
between unimported default argument and new default
argument
Product: clang
Version: unspecified
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: Modules
Assignee: unassignedclangbugs at nondot.org
Reporter: richard-llvm at metafoo.co.uk
CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
Classification: Unclassified
Suppose we have:
m1.h: (empty)
m2.h: void f(int = 0);
module.map: module m { module m1 { header "m1.h" } module m2 { header "m2.h" }
}
tu.cc: import m1; void f(int = 0);
Right now, we'll reject this due to the redefinition of the default argument
for 'f'. We should (probably) allow this, because the default argument is not
visible in tu.cc (so it's not redundant).
Further, we should check that the default argument matches that from the
invisible declaration, as is required by [dcl.fct.default]p4 ("the accumulated
sets of default arguments at the end of the translation units shall be the
same").
Finally, we might want to warn whenever this happens ("default argument for 1st
parameter of function 'foo' is also provided by module 'blah'; consider
importing that module instead of redefining the default argument") since it
indicates layering confusion / non-modular code.
--
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/20140420/c47f2f23/attachment.html>
More information about the llvm-bugs
mailing list