[LLVMbugs] [Bug 7944] New: diagnostic missing source location when used with macro

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Aug 19 16:22:34 PDT 2010


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

           Summary: diagnostic missing source location when used with
                    macro
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: nlewycky at google.com
                CC: llvmbugs at cs.uiuc.edu


This unassuming program has a common syntax error:

  #define MACRO(x) x

  struct B {
    int f() { return true; }
  };
  struct A {
    B* b() { return new B; }
  };
  void g() {
    A a;
    MACRO(a.b->f());
  }

but the diagnostic is missing important information:

  $ clang++ -fsyntax-only x.cc
  error: base of member reference has function type 'B *()'; perhaps you meant
to
        call this function with '()'?
  1 error generated.

No source file, no line number, no caret highlighting. If you remove the macro
then it works just fine.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list