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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to