[llvm-commits] [PATCH] Add declaration of hash_value in APFloat / APInt (required for xlC on AIX)

David Blaikie dblaikie at gmail.com
Sat Oct 27 22:19:51 PDT 2012


On Sat, Oct 27, 2012 at 12:29 PM, Kai <kai at redstar.de> wrote:
> Hi!
>
> I am trying to compile LLVM with the IBM xlC compiler on AIX 7.1 The first
> issue I encounter is that the function hash_value() is declared as a friend
> of APFloat and APInt, but no matching declaration is provided. This results
> in the error message:
>
> "../llvm-git/lib/Support/APFloat.cpp", line 2731.11: 1540-0432 (S) The
> qualified declarator "llvm::hash_value" must refer to an existing
> declaration.
>
> The draft standard says in section 7.3.1.2 "Namespace member definitions":
>
> "... If a friend declaration in a non-local class first declares a class or
> function95 the friend class or function is a member of the innermost
> enclosing namespace. The name of the friend is not found by unqualified
> lookup (3.4.1) or by qualified lookup (3.4.3) until a matching declaration
> is provided in that namespace scope (either before or after the class
> definition granting friendship). ..."
>
> I conclude that the declaration is required for conformance with the C++
> standard. The attached patch resolves the problem.
>
> Please review and commit if it looks good.

Would you mind filing a Clang bug if this isn't being currently
diagnosed by Clang?

- David



More information about the llvm-commits mailing list