diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-11-10 20:24:21 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-11-10 20:24:21 +0000 |
commit | a66d3bb056932868dac7ac76d6ed22b09281bc80 (patch) | |
tree | ceb108c7099379bb8da9b4c01aeafdb18a4ca7bd | |
parent | d65587f7a6d38965fa37158d3f57990a7faf3836 (diff) |
Document a language-compatibility issue with function parameter names in function prototypes in C++
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118712 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | www/compatibility.html | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/www/compatibility.html b/www/compatibility.html index c25ea8a4aa..d33686d151 100644 --- a/www/compatibility.html +++ b/www/compatibility.html @@ -56,6 +56,7 @@ <li><a href="#default_init_const">Default initialization of const variable of a class type requires user-defined default constructor</a></li> + <li><a href="#param_name_lookup">Parameter name lookup</a></li> </ul> </li> <li><a href="#objective-c++">Objective-C++ compatibility</a> @@ -675,6 +676,18 @@ void Bar() { </pre> <!-- ======================================================================= --> +<h3 id="param_name_lookup">Parameter name lookup</h3> +<!-- ======================================================================= --> + +<p>Due to a bug in its implementation, GCC allows the redeclaration of function parameter names within a function prototype in C++ code, e.g.</p> +<blockquote> +<pre> +void f(int a, int a); +</pre> +</blockquote> +<p>Clang diagnoses this error (where the parameter name has been redeclared). To fix this problem, rename one of the parameters.</p> + +<!-- ======================================================================= --> <h2 id="objective-c++">Objective-C++ compatibility</h3> <!-- ======================================================================= --> |