Skip to content

Clang incorrectly identifies a member variable access as a free function template name #59910

@dwblaikie

Description

@dwblaikie

https://godbolt.org/z/radhszraP

namespace foo {

template <typename T>
struct bar {};

}

using foo::bar;

template <class T>
struct A {
  struct B {
    int bar;
  };

  bool g(B& v) {
    return v.bar < 42;
  }
};

Clang output:

<source>:17:22: error: expected '>'
    return v.bar < 42;
                     ^
<source>:17:18: note: to match this '<'
    return v.bar < 42;
                 ^
<source>:17:22: error: expected unqualified-id
    return v.bar < 42;
                     ^
2 errors generated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions