'Is there any rule about why is the redefinition of the enumerator ill-formed?
Consider this example
enum class A{
a = 0,
a = 1
};
The compilers will report an error, which is the "redefinition of enumerator 'a'". However, [basic.def.odr#1] does not have any requirement for the enumerator
No translation unit shall contain more than one definition of any variable, function, class type, enumeration type, template, default argument for a parameter (for a function in a given scope), or default template argument.
I wonder which normative rule, in the standard, is restricting that?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
