llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.83k stars 11.91k forks source link

Cannot Find Conversion Operator #44717

Open llvmbot opened 4 years ago

llvmbot commented 4 years ago
Bugzilla Link 45372
Version trunk
OS Linux
Reporter LLVM Bugzilla Contributor
CC @DougGregor,@zygoloid

Extended Description

In the following MWE https://godbolt.org/z/F3gHe2 clang states that the conversion operator to int does not exist.

clang only complains about function f, while explicitly calling the operator does not result in an error.

Additionally gcc and msvc accept this code.

This behaviour is present in the versions 6 to trunk.

llvmbot commented 3 months ago

@llvm/issue-subscribers-clang-frontend

Author: None (llvmbot)

| | | | --- | --- | | Bugzilla Link | [45372](https://llvm.org/bz45372) | | Version | trunk | | OS | Linux | | Reporter | LLVM Bugzilla Contributor | | CC | @DougGregor,@zygoloid | ## Extended Description In the following MWE https://godbolt.org/z/F3gHe2 clang states that the conversion operator to int does not exist. clang only complains about function `f`, while explicitly calling the operator does not result in an error. Additionally gcc and msvc accept this code. This behaviour is present in the versions 6 to trunk.
shafik commented 3 months ago

Looks like a clang bug we don't see the conversion operator in the body of A: https://godbolt.org/z/GeTdqqsrn