11
22void f (int ii) {
33 if (1 ) {
4- for (int ii = 1 ; ii < 10 ; ii++) { // local variable hides global variable
4+ for (int ii = 1 ; ii < 10 ; ii++) { // local variable hides parameter of the same name
55 ;
66 }
77 }
@@ -12,7 +12,7 @@ namespace foo {
1212 void f2 (int ii, int kk) {
1313 try {
1414 for (ii = 0 ; ii < 3 ; ii++) {
15- int kk; // local variable hides global variable
15+ int kk; // local variable hides parameter of the same name
1616 }
1717 }
1818 catch (int ee) {
@@ -25,7 +25,7 @@ void myFunction(int a, int b, int c);
2525
2626void myFunction (int a, int b, int _c) {
2727 {
28- int a = a; // local variable hides global variable
28+ int a = a; // local variable hides parameter of the same name
2929 int _b = b;
3030 int c = _c;
3131
@@ -42,7 +42,7 @@ class MyTemplateClass {
4242template <class T >
4343void MyTemplateClass<T> :: myMethod(int a, int b, int _c) {
4444 {
45- int a = a; // local variable hides global variable
45+ int a = a; // local variable hides parameter of the same name
4646 int _b = b;
4747 int c = _c;
4848
@@ -61,7 +61,7 @@ void test() {
6161void testMacro (int i) {
6262 MYMACRO;
6363
64- for (int i = 0 ; i < 10 ; i++) {}; // local variable hides global variable
64+ for (int i = 0 ; i < 10 ; i++) {}; // local variable hides parameter of the same name
6565}
6666
6767#include " hiding.h"
@@ -75,7 +75,7 @@ void myClass::myMethod(int arg1, T arg2) {
7575 {
7676 int protoArg1;
7777 T protoArg2;
78- int arg1; // local variable hides global variable
79- T arg2; // local variable hides global variable
78+ int arg1; // local variable hides parameter of the same name
79+ T arg2; // local variable hides parameter of the same name
8080 }
8181}
0 commit comments