aboutsummaryrefslogtreecommitdiff
path: root/clang/test
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2022-08-09 11:35:37 -0400
committerTobias Hieta <tobias@hieta.se>2022-08-12 08:35:50 +0200
commit1fc6119ace14cd9baf00866f776cdd02d3af1308 (patch)
tree1c57afbc0df696f33a699b5421b50d5ca22eba8c /clang/test
parentd945a2c9efda8f0a2d8a03cf48d5b5dc4076769d (diff)
downloadllvm-1fc6119ace14cd9baf00866f776cdd02d3af1308.zip
llvm-1fc6119ace14cd9baf00866f776cdd02d3af1308.tar.gz
llvm-1fc6119ace14cd9baf00866f776cdd02d3af1308.tar.bz2
Change prototype merging error into a warning for builtins
As was observed in https://reviews.llvm.org/D123627#3707635, it's confusing that a user can write: ``` float rintf(void) {} ``` and get a warning, but writing: ``` float rintf() {} ``` gives an error. This patch changes the behavior so that both are warnings, so that users who have functions which conflict with a builtin identifier can still use that identifier as they wish. Differential Revision: https://reviews.llvm.org/D131499 (cherry picked from commit 4c02ab8c9742f6c32b17f49a306b3b072486f5c5)
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Sema/prototype-redecls.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/test/Sema/prototype-redecls.c b/clang/test/Sema/prototype-redecls.c
index ed569b5..49305db 100644
--- a/clang/test/Sema/prototype-redecls.c
+++ b/clang/test/Sema/prototype-redecls.c
@@ -29,7 +29,7 @@ void garp(x) int x; {}
// Ensure redeclarations that conflict with a builtin use a note which makes it
// clear that the previous declaration was a builtin.
-float rintf() { // expected-error {{conflicting types for 'rintf'}} \
+float rintf() { // expected-warning {{incompatible redeclaration of library function 'rintf'}} \
expected-note {{'rintf' is a builtin with type 'float (float)'}}
return 1.0f;
}