[llvm-bugs] [Bug 42504] New: Unable to call static member function from within the class own scope

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jul 3 21:46:20 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=42504

            Bug ID: 42504
           Summary: Unable to call static member function from within the
                    class own scope
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: heavenandhell171 at gmail.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

$ cat test.cpp
template <char Start, char End>
struct range {
  static_assert(range::validate());

  static constexpr auto validate() -> bool {
    return Start <= End;
  }
};

$ clang++ -std=c++17 test.cpp
test.cpp:3:24: error: no member named 'validate' in 'range<Start, End>'

  static_assert(range::validate());

                ~~~~~~~^

1 error generated.

This also doesn't work:

$ cat test.cpp
template <char Start, char End>
struct range {
  static constexpr bool valid = range::validate();

  static constexpr auto validate() -> bool {
    return Start <= End;
  }
};

$ clang++ -std=c++17 test.cpp
test.cpp:3:40: error: no member named 'validate' in 'range<Start, End>'

  static constexpr bool valid = range::validate();

                                ~~~~~~~^

1 error generated.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190704/c2243bd5/attachment-0001.html>


More information about the llvm-bugs mailing list