Skip to content

Commit 798feb4

Browse files
committed
[test] Make absolute line numbers relative; NFC
Done to remove noise from https://reviews.llvm.org/D32332 (and to make this test more resilient to changes in general). llvm-svn: 305947
1 parent 34caf53 commit 798feb4

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

clang/test/Sema/overloadable.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ void fn_type_conversions() {
106106
void foo(char *c) __attribute__((overloadable));
107107
void (*ptr1)(void *) = &foo;
108108
void (*ptr2)(char *) = &foo;
109-
void (*ambiguous)(int *) = &foo; // expected-error{{initializing 'void (*)(int *)' with an expression of incompatible type '<overloaded function type>'}} expected-note@105{{candidate function}} expected-note@106{{candidate function}}
110-
void *vp_ambiguous = &foo; // expected-error{{initializing 'void *' with an expression of incompatible type '<overloaded function type>'}} expected-note@105{{candidate function}} expected-note@106{{candidate function}}
109+
void (*ambiguous)(int *) = &foo; // expected-error{{initializing 'void (*)(int *)' with an expression of incompatible type '<overloaded function type>'}} expected-note@-4{{candidate function}} expected-note@-3{{candidate function}}
110+
void *vp_ambiguous = &foo; // expected-error{{initializing 'void *' with an expression of incompatible type '<overloaded function type>'}} expected-note@-5{{candidate function}} expected-note@-4{{candidate function}}
111111

112112
void (*specific1)(int *) = (void (*)(void *))&foo; // expected-warning{{incompatible function pointer types initializing 'void (*)(int *)' with an expression of type 'void (*)(void *)'}}
113113
void *specific2 = (void (*)(void *))&foo;
@@ -117,8 +117,8 @@ void fn_type_conversions() {
117117
void disabled(char *c) __attribute__((overloadable, enable_if(1, "The function name lies.")));
118118
// To be clear, these should all point to the last overload of 'disabled'
119119
void (*dptr1)(char *c) = &disabled;
120-
void (*dptr2)(void *c) = &disabled; // expected-warning{{incompatible pointer types initializing 'void (*)(void *)' with an expression of type '<overloaded function type>'}} expected-note@115{{candidate function made ineligible by enable_if}} expected-note@116{{candidate function made ineligible by enable_if}} expected-note@117{{candidate function has type mismatch at 1st parameter (expected 'void *' but has 'char *')}}
121-
void (*dptr3)(int *c) = &disabled; // expected-warning{{incompatible pointer types initializing 'void (*)(int *)' with an expression of type '<overloaded function type>'}} expected-note@115{{candidate function made ineligible by enable_if}} expected-note@116{{candidate function made ineligible by enable_if}} expected-note@117{{candidate function has type mismatch at 1st parameter (expected 'int *' but has 'char *')}}
120+
void (*dptr2)(void *c) = &disabled; // expected-warning{{incompatible pointer types initializing 'void (*)(void *)' with an expression of type '<overloaded function type>'}} expected-note@-5{{candidate function made ineligible by enable_if}} expected-note@-4{{candidate function made ineligible by enable_if}} expected-note@-3{{candidate function has type mismatch at 1st parameter (expected 'void *' but has 'char *')}}
121+
void (*dptr3)(int *c) = &disabled; // expected-warning{{incompatible pointer types initializing 'void (*)(int *)' with an expression of type '<overloaded function type>'}} expected-note@-6{{candidate function made ineligible by enable_if}} expected-note@-5{{candidate function made ineligible by enable_if}} expected-note@-4{{candidate function has type mismatch at 1st parameter (expected 'int *' but has 'char *')}}
122122

123123
void *specific_disabled = &disabled;
124124
}
@@ -131,14 +131,14 @@ void incompatible_pointer_type_conversions() {
131131
void foo(char *c) __attribute__((overloadable));
132132
void foo(short *c) __attribute__((overloadable));
133133
foo(charbuf);
134-
foo(ucharbuf); // expected-error{{call to 'foo' is ambiguous}} expected-note@131{{candidate function}} expected-note@132{{candidate function}}
135-
foo(intbuf); // expected-error{{call to 'foo' is ambiguous}} expected-note@131{{candidate function}} expected-note@132{{candidate function}}
134+
foo(ucharbuf); // expected-error{{call to 'foo' is ambiguous}} expected-note@-3{{candidate function}} expected-note@-2{{candidate function}}
135+
foo(intbuf); // expected-error{{call to 'foo' is ambiguous}} expected-note@-4{{candidate function}} expected-note@-3{{candidate function}}
136136

137137
void bar(unsigned char *c) __attribute__((overloadable));
138138
void bar(signed char *c) __attribute__((overloadable));
139-
bar(charbuf); // expected-error{{call to 'bar' is ambiguous}} expected-note@137{{candidate function}} expected-note@138{{candidate function}}
139+
bar(charbuf); // expected-error{{call to 'bar' is ambiguous}} expected-note@-2{{candidate function}} expected-note@-1{{candidate function}}
140140
bar(ucharbuf);
141-
bar(intbuf); // expected-error{{call to 'bar' is ambiguous}} expected-note@137{{candidate function}} expected-note@138{{candidate function}}
141+
bar(intbuf); // expected-error{{call to 'bar' is ambiguous}} expected-note@-4{{candidate function}} expected-note@-3{{candidate function}}
142142
}
143143

144144
void dropping_qualifiers_is_incompatible() {
@@ -148,8 +148,8 @@ void dropping_qualifiers_is_incompatible() {
148148
void foo(char *c) __attribute__((overloadable));
149149
void foo(const volatile unsigned char *c) __attribute__((overloadable));
150150

151-
foo(ccharbuf); // expected-error{{call to 'foo' is ambiguous}} expected-note@148{{candidate function}} expected-note@149{{candidate function}}
152-
foo(vcharbuf); // expected-error{{call to 'foo' is ambiguous}} expected-note@148{{candidate function}} expected-note@149{{candidate function}}
151+
foo(ccharbuf); // expected-error{{call to 'foo' is ambiguous}} expected-note@-3{{candidate function}} expected-note@-2{{candidate function}}
152+
foo(vcharbuf); // expected-error{{call to 'foo' is ambiguous}} expected-note@-4{{candidate function}} expected-note@-3{{candidate function}}
153153
}
154154

155155
// Bug: we used to treat `__typeof__(foo)` as though it was `__typeof__(&foo)`

0 commit comments

Comments
 (0)