[llvm-bugs] [Bug 25223] New: clang could emit a better diagnostic for (invalid) out-of-class-definition of member functions

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Oct 16 17:55:54 PDT 2015


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

            Bug ID: 25223
           Summary: clang could emit a better diagnostic for (invalid)
                    out-of-class-definition of member functions
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: davide at freebsd.org
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

template<class T>
class X {
  T f(T x) { return x; }

  T foo(void);
};


template<class T>
T X::foo(void)
{
  return f(5);
}

For the code above clang emits the following diagnostic:

 % ./clang template.cpp -o template -Wall
template.cpp:14:3: error: 'X' is not a class, namespace, or enumeration
T X::foo(void)
  ^
template.cpp:2:7: note: 'X' declared here
class X {
      ^
1 error generated.


But X is actually a class, so the error is a little bit misleading.

-- 
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/20151017/a97c3b1e/attachment.html>


More information about the llvm-bugs mailing list