Skip to content

Commit 467c478

Browse files
committed
[clang][NFC] Add test for CWG1898 "Use of “equivalent” in overload resolution"
1 parent ac5a201 commit 467c478

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed

clang/test/CXX/drs/cwg18xx.cpp

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -640,3 +640,48 @@ namespace H {
640640
struct S s;
641641
}
642642
}
643+
644+
namespace cwg1898 { // cwg1898: 2.7
645+
void e(int) {} // #cwg1898-e-int
646+
void e(int) {}
647+
// expected-error@-1 {{redefinition of 'e'}}
648+
// expected-note@#cwg1898-e-int {{previous definition is here}}
649+
void e(long) {}
650+
651+
void f(int) {} // #cwg1898-f-int
652+
void f(const int) {}
653+
// expected-error@-1 {{redefinition of 'f'}}
654+
// expected-note@#cwg1898-f-int {{previous definition is here}}
655+
656+
void g(int) {} // #cwg1898-g-int
657+
void g(volatile int) {}
658+
// since-cxx20-warning@-1 {{volatile-qualified parameter type 'volatile int' is deprecated}}
659+
// expected-error@-2 {{redefinition of 'g'}}
660+
// expected-note@#cwg1898-g-int {{previous definition is here}}
661+
662+
void h(int *) {} // #cwg1898-h-int
663+
void h(int[]) {}
664+
// expected-error@-1 {{redefinition of 'h'}}
665+
// expected-note@#cwg1898-h-int {{previous definition is here}}
666+
667+
void i(int *) {} // #cwg1898-i-int
668+
void i(int[2]) {}
669+
// expected-error@-1 {{redefinition of 'i'}}
670+
// expected-note@#cwg1898-i-int {{previous definition is here}}
671+
672+
void j(void(*)()) {} // #cwg1898-j-int
673+
void j(void()) {}
674+
// expected-error@-1 {{redefinition of 'j'}}
675+
// expected-note@#cwg1898-j-int {{previous definition is here}}
676+
677+
struct A {
678+
void k(int) {} // #cwg1898-k-int
679+
void k(int) {}
680+
// expected-error@-1 {{class member cannot be redeclared}}
681+
// expected-note@#cwg1898-k-int {{previous definition is here}}
682+
};
683+
684+
struct B : A {
685+
void k(int) {}
686+
};
687+
} // namespace cwg1898

clang/www/cxx_dr_status.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11219,7 +11219,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
1121911219
<td><a href="https://cplusplus.github.io/CWG/issues/1898.html">1898</a></td>
1122011220
<td>CD6</td>
1122111221
<td>Use of &#8220;equivalent&#8221; in overload resolution</td>
11222-
<td class="unknown" align="center">Unknown</td>
11222+
<td class="full" align="center">Clang 2.7</td>
1122311223
</tr>
1122411224
<tr id="1899">
1122511225
<td><a href="https://cplusplus.github.io/CWG/issues/1899.html">1899</a></td>

0 commit comments

Comments
 (0)