http://llvm.org/bugs/show_bug.cgi?id=20001

            Bug ID: 20001
           Summary: should offer to add missing namespace
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Testcase:

struct X {
  void test() {
    static_cast<void(X::*)(int)>(&memfn);
  }
  template<typename T> void memfn(T);
};

We currently emit:

abcdefg-x.cc:3:5: error: address of overloaded function 'memfn' cannot be
      static_cast to type 'void (X::*)(int)'
    static_cast<void(X::*)(int)>(&memfn);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
abcdefg-x.cc:5:29: note: candidate function
  template<typename T> void memfn(T);
                            ^
1 error generated.

When memfn is not a template, we get:

abcdefg-x.cc:3:34: error: must explicitly qualify name of member function when
      taking its address
    static_cast<void(X::*)(int)>(&memfn);
                                 ^~~~~~
                                  X::

which is much better.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to