https://llvm.org/bugs/show_bug.cgi?id=31640
Bug ID: 31640 Summary: diagnose_if generates better diagnostics as a warning Product: clang Version: trunk Hardware: All OS: All Status: NEW Severity: normal Priority: P Component: C++ Assignee: unassignedclangb...@nondot.org Reporter: e...@efcs.ca CC: dgre...@apple.com, llvm-bugs@lists.llvm.org Classification: Unclassified Currently diagnose_if produces entirely different diagnostics when used as an error instead of a warning. The error diagnostic is equivalent to an "unavailable(msg)" diagnostic while the warning simply generates "warning: msg". I believe the error diagnostic is misleading and should be change to match the warning diagnostics. Example: void foo(int i) __attribute__((diagnose_if(i, "my warning", "warning"))) {} void foo(long i) {} void bar(int i) __attribute__((diagnose_if(i, "my error", "error"))) {} void bar(long i) {} int main() { foo(1); // expected-warning {{my warning}} bar(1); // expected-error {{call to unavailable function 'bar'}} } -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs