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

            Bug ID: 23564
           Summary: Bad diagnostic message for static class functions
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

$ cat bad_msg.cc 
#define MY_EXPORT __attribute__((visibility("default")))

struct Foo {
  MY_EXPORT static int AwesomeFunction(int, int);
};

int main() {
  return Foo::AwesomeFunction(-1);
}
$ clang++ bad_msg.cc
bad_msg.cc:8:33: error: too few arguments to function call, expected 2, have 1
  return Foo::AwesomeFunction(-1);
         ~~~~~~~~~~~~~~~~~~~~   ^
bad_msg.cc:4:3: note: 'AwesomeFunction' declared here
  MY_EXPORT static int AwesomeFunction(int, int);
  ^
bad_msg.cc:1:19: note: expanded from macro 'MY_EXPORT'
#define MY_EXPORT __attribute__((visibility("default")))
                  ^
1 error generated.

Tracing through the macro definition isn't useful here, since it's misleading:
the actual function definition isn't inside the macro.

This is at r233105

-- 
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