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

            Bug ID: 23431
           Summary: Unhelpful diagnostics upon unknown function-like macro
                    invocation
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

> $ cat test.cc
> void f() { M("" << ""); }
>
> $ clang++ -fsyntax-only test.cc
> test.cc:1:17: error: invalid operands to binary expression ('const char *' 
> and 'const char *')
> void f() { M("" << ""); }
>              ~~ ^  ~~
> 1 error generated.

doesn't mention at all that M is unknown, and if M is e.g. defined as

  #define M(x) std::cout << x

then the provided diagnostics is kind of a red herring.  (Happens in practice,
cf. e.g.,
<http://cgit.freedesktop.org/libreoffice/core/commit/?id=c47f7dfb3045b7b029859ea1fac80143b996945b>.)

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