From a66d3bb056932868dac7ac76d6ed22b09281bc80 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Wed, 10 Nov 2010 20:24:21 +0000 Subject: [PATCH] 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 --- www/compatibility.html | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 @@
  • Default initialization of const variable of a class type requires user-defined default constructor
  • +
  • Parameter name lookup
  • Objective-C++ compatibility @@ -674,6 +675,18 @@ void Bar() { } + +

    Parameter name lookup

    + + +

    Due to a bug in its implementation, GCC allows the redeclaration of function parameter names within a function prototype in C++ code, e.g.

    +
    +
    +void f(int a, int a);
    +
    +
    +

    Clang diagnoses this error (where the parameter name has been redeclared). To fix this problem, rename one of the parameters.

    +

    Objective-C++ compatibility

    -- 2.40.0