Code version 2 of the GNU General Public License the Creative Commons Attribution-ShareAlike 3.0 License

GCC 4.3 now errors out on certain situations in C++ where a given name may refer to more than one type or function. Within a scope, a given name can refer to only type or function. For example, in the following code, the name foo changes meaning:

class foo {};
class bar
		void do_silly(foo) {}
		void foo() {}

Note that on line 5, foo refers to class foo, whereas on line 6 and after, foo refers to void foo(). This isn't allowed because it changes the meaning of foo. The reason that this isn't allowed in C++ is because if in the definition of bar we write foo(), it is ambiguous whether we want to instantiate an object of type class foo or call this->foo().

Note that this can also happen with two different types. The solution in either case is either to move one of the names such that it is not in scope, or to rename one of the names. Note that in the case with the function, it is usually easier to rename the function. If you are a library developer, please do not forget to bump the SONAME if you change the ABI.