Skip to content

[Clang] Bug with lookup #94052

Closed as duplicate of#28181
Closed as duplicate of#28181
@elizabethandrews

Description

@elizabethandrews

The following code compiles with GCC and MSVC but fails with clang

namespace a {
template <typename> class b {
  public:
  typedef int string_type;
  operator string_type();
};
} // namespace a
template <class> void c() {
    &a::b<char>::operator string_type; 
}

Godbolt - https://godbolt.org/z/sWs8rvq98

Clang accepts the code if string_type is qualified - https://godbolt.org/z/efPd9d8Gz . Based on examples in http://eel.is/c++draft/basic.lookup#unqual-5, I think the lookup should succeed without qualification as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"diverges-from:gccDoes the clang frontend diverge from gcc on this issuediverges-from:msvcDoes the clang frontend diverge from msvc on this issueduplicateResolved as duplicate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions