[clang] [Clang][Sema] Diagnose friend declarations with enum elaborated-type-specifier in all language modes (PR #80171)
Vlad Serebrennikov via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 6 09:24:13 PST 2024
================
@@ -252,4 +252,14 @@ namespace dr2397 { // dr2397: 17
auto (*c)[5] = &a;
}
} // namespace dr2397
+
+// CWG2363 was closed as NAD, but its resolution does affirm that
+// a friend declaration cannot have an opaque-enumm-specifier.
+namespace dr2363 { // dr2363: yes
+struct A {
+ friend enum class E; // since-cxx11-error {{reference to enumeration must use 'enum' not 'enum class'}}
----------------
Endilll wrote:
Can you follow the `// expected-error at -1` style of expected directives, like the rest of the file?
https://github.com/llvm/llvm-project/pull/80171
More information about the cfe-commits
mailing list