Skip to content

Commit dece2b9

Browse files
committed
Adding tests.
1 parent 227d45e commit dece2b9

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

clang/test/SemaCXX/cxx98-compat.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,3 +434,15 @@ void ctad_test() {
434434
CTAD t = s; // expected-warning {{class template argument deduction is incompatible with C++ standards before C++17}}
435435
}
436436
#endif
437+
438+
namespace GH161702 {
439+
struct S {
440+
enum E { A };
441+
using E::A; // expected-warning {{enumeration type in nested name specifier is incompatible with C++98}}
442+
#ifndef CXX20COMPAT
443+
// expected-error@-2 {{using declaration refers to its own class}}
444+
#else
445+
// expected-warning@-4 {{member using declaration naming non-class ''E'' enumerator is incompatible with C++ standards before C++20}}
446+
#endif
447+
};
448+
}

0 commit comments

Comments
 (0)