This revision was automatically updated to reflect the committed changes.
Closed by commit rC336748: Remove qualtype qualifier in coroutine error to 
prevent assert in debug (authored by modocache, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D49099?vs=154692&id=154910#toc

Repository:
  rC Clang

https://reviews.llvm.org/D49099

Files:
  include/clang/Basic/DiagnosticSemaKinds.td
  test/SemaCXX/coroutine-traits-undefined-template.cpp


Index: include/clang/Basic/DiagnosticSemaKinds.td
===================================================================
--- include/clang/Basic/DiagnosticSemaKinds.td
+++ include/clang/Basic/DiagnosticSemaKinds.td
@@ -9082,7 +9082,7 @@
   "this function cannot be a coroutine: %0 is an incomplete type">;
 def err_coroutine_type_missing_specialization : Error<
   "this function cannot be a coroutine: missing definition of "
-  "specialization %q0">;
+  "specialization %0">;
 def err_coroutine_promise_incompatible_return_functions : Error<
   "the coroutine promise type %0 declares both 'return_value' and 
'return_void'">;
 def err_coroutine_promise_requires_return_function : Error<
Index: test/SemaCXX/coroutine-traits-undefined-template.cpp
===================================================================
--- test/SemaCXX/coroutine-traits-undefined-template.cpp
+++ test/SemaCXX/coroutine-traits-undefined-template.cpp
@@ -0,0 +1,21 @@
+// test/SemaCXX/coroutine-traits-undefined-template.cpp
+
+// This file contains references to sections of the Coroutines TS, which can be
+// found at http://wg21.link/coroutines.
+
+// RUN: %clang_cc1 -std=c++14 -fcoroutines-ts -verify %s -fcxx-exceptions 
-fexceptions -Wunused-result
+
+namespace std {
+namespace experimental {
+
+template<typename ...T>
+struct coroutine_traits {
+  struct promise_type {};
+};
+
+template<> struct coroutine_traits<void>; // expected-note {{forward 
declaration of 'std::experimental::coroutine_traits<void>'}}
+}} // namespace std::experimental
+
+void uses_forward_declaration() {
+  co_return; // expected-error {{this function cannot be a coroutine: missing 
definition of specialization 'coroutine_traits<void>'}}
+}


Index: include/clang/Basic/DiagnosticSemaKinds.td
===================================================================
--- include/clang/Basic/DiagnosticSemaKinds.td
+++ include/clang/Basic/DiagnosticSemaKinds.td
@@ -9082,7 +9082,7 @@
   "this function cannot be a coroutine: %0 is an incomplete type">;
 def err_coroutine_type_missing_specialization : Error<
   "this function cannot be a coroutine: missing definition of "
-  "specialization %q0">;
+  "specialization %0">;
 def err_coroutine_promise_incompatible_return_functions : Error<
   "the coroutine promise type %0 declares both 'return_value' and 'return_void'">;
 def err_coroutine_promise_requires_return_function : Error<
Index: test/SemaCXX/coroutine-traits-undefined-template.cpp
===================================================================
--- test/SemaCXX/coroutine-traits-undefined-template.cpp
+++ test/SemaCXX/coroutine-traits-undefined-template.cpp
@@ -0,0 +1,21 @@
+// test/SemaCXX/coroutine-traits-undefined-template.cpp
+
+// This file contains references to sections of the Coroutines TS, which can be
+// found at http://wg21.link/coroutines.
+
+// RUN: %clang_cc1 -std=c++14 -fcoroutines-ts -verify %s -fcxx-exceptions -fexceptions -Wunused-result
+
+namespace std {
+namespace experimental {
+
+template<typename ...T>
+struct coroutine_traits {
+  struct promise_type {};
+};
+
+template<> struct coroutine_traits<void>; // expected-note {{forward declaration of 'std::experimental::coroutine_traits<void>'}}
+}} // namespace std::experimental
+
+void uses_forward_declaration() {
+  co_return; // expected-error {{this function cannot be a coroutine: missing definition of specialization 'coroutine_traits<void>'}}
+}
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to