[LLVMbugs] [Bug 24033] New: Redeclaration inconsistency between struct and int
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Sun Jul 5 07:09:18 PDT 2015
https://llvm.org/bugs/show_bug.cgi?id=24033
Bug ID: 24033
Summary: Redeclaration inconsistency between struct and int
Product: clang
Version: trunk
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P
Component: C++
Assignee: unassignedclangbugs at nondot.org
Reporter: anders.granlund.0 at gmail.com
CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
Classification: Unclassified
The following program gives no error when compiling with clang:
namespace X {
struct i {};
}
namespace Y {
using X::i;
struct i {};
}
int main() {}
Let's use int instead of struct, then we get:
namespace X {
int i;
}
namespace Y {
using X::i;
int i;
}
int main() {}
This program gives a redefinition error when compiling with clang.
The only difference between the programs is the kind of entity used (struct or
int), but one compiles without errors and the other gives a redeclaration
error.
Maybe the standard is ambiguous what a redefinition is when it comes to
using-declarations. But shouldn't a compiler make its interpretation
consistently? What is the reason for this inconsistency?
--
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/20150705/fd02dece/attachment.html>
More information about the llvm-bugs
mailing list