You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"a type's implementation may not declare a name that is the same as (i.e., shadows) a type scope name - for example, a type scope function's local variable may not have the same as one of the type's members"
if (!check_shadowing_of_type_scope_names(*n.declaration)) {
3212
+
return;
3213
+
}
3214
+
3184
3215
if (n.mod == parameter_declaration_node::modifier::implicit)
3185
3216
{
3186
3217
if (
@@ -3655,20 +3686,7 @@ class cppfront
3655
3686
;
3656
3687
auto is_in_type = n.parent_is_type();
3657
3688
3658
-
// In a type scope function, disallow declaring a name that is
3659
-
// the same as (i.e., shadows) a type scope name... this is a
3660
-
// convenient place to check because we have the decls stack
3661
-
if (
3662
-
n.has_name() // this is a named declaration
3663
-
&& !n.parent_is_type() // where the type isn't the direct parent
3664
-
&& is_name_declared_in_current_type_scope(*n.name()) // and it shadows a name
3665
-
&& !emit_constructor_as_assignment // (don't emit the error twice if this is the
3666
-
) // second time we're 're handling this function)
3667
-
{
3668
-
errors.emplace_back(
3669
-
n.position(),
3670
-
"a type's implementation may not declare a name that is the same as (i.e., shadows) a type scope name - for example, a type scope function's local variable may not have the same as one of the type's members"
0 commit comments