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

            Bug ID: 50767
           Summary: Function __attribute__((nodebug)) inconsistency causes
                    crash
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]

When the nodebug attribute of a function appears only at its definition (so an
earlier declaration of the function did not have the attribute) this crashes
clang.

Example:

  void foo();

  void use() { foo(); }

  __attribute__((nodebug)) void foo() { }

Command:
   clang -c -g1 -O nodbg.cpp

Godbolt link: https://godbolt.org/z/nTYKW66Gf

On an assertion build, I think the error message is "function definition may
only have a distinct !dbg attachment" then "fatal error: error in backend:
Broken module found, compilation aborted!"

If needed that you annotate earlier declarations with nodebug, clang should
enforce this?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to