Skip to content

Commit

Permalink
codify expectations toward redeclarations with tests
Browse files Browse the repository at this point in the history
confirmed with GCC that these are actually enforced (a function with an enum type is not compatible with a function with an int type)
  • Loading branch information
ckaestne committed Feb 12, 2015
1 parent aff7962 commit 7b16d3a
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,19 @@ class RedeclarationTest extends FunSuite with Matchers with TestHelperTS {
check("int foo();" +
"int foo() {}")
}
assertResult(true) {
check("extern int foo();" +
"int foo() {}")
}
assertResult(false) {
check("int foo(int p);" +
"int foo() {}")
}
assertResult(false) {
check("enum x { a, b }; " +
"int foo(int p);" +
"int foo(enum x y) {}")
}
assertResult(false) {
//actually just a warning in GCC
check("int foo();" +
Expand Down

0 comments on commit 7b16d3a

Please sign in to comment.