forked from llvm-mirror/clang
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Sema] Create a separate group for incompatible function pointer warning
Give incompatible function pointer warning its own diagnostic group but still leave it as a subgroup of incompatible-pointer-types. This is in preparation to promote -Wincompatible-function-pointer-types to error on darwin. Differential Revision: https://reviews.llvm.org/D22248 rdar://problem/12907612 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275907 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
1 parent
238b19c
commit 5de4c50
Showing
6 changed files
with
46 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// RUN: %clang_cc1 -fsyntax-only %s -Wincompatible-pointer-types -verify | ||
// RUN: %clang_cc1 -fsyntax-only %s -Wincompatible-function-pointer-types -verify | ||
|
||
// This test ensures that the subgroup of -Wincompatible-pointer-types warnings | ||
// that concern function pointers can be promoted (or not promoted) to an error | ||
// *separately* from the other -Wincompatible-pointer-type warnings. | ||
typedef int (*MyFnTyA)(int *, char *); | ||
|
||
int bar(char *a, int *b) { return 0; } | ||
int foo(MyFnTyA x) { return 0; } // expected-note {{passing argument to parameter 'x' here}} | ||
|
||
void baz() { | ||
foo(&bar); // expected-warning {{incompatible function pointer types passing 'int (*)(char *, int *)' to parameter of type 'MyFnTyA' (aka 'int (*)(int *, char *)')}} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters