tbaeder created this revision. tbaeder added a reviewer: aaron.ballman. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits.
The integer value of the enum here is `6`, which wasn't covered by the diagnostic. This fixes https://github.com/llvm/llvm-project/issues/57415 Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D132821 Files: clang/include/clang/Basic/DiagnosticParseKinds.td clang/test/Parser/cxx-concept-declaration.cpp Index: clang/test/Parser/cxx-concept-declaration.cpp =================================================================== --- clang/test/Parser/cxx-concept-declaration.cpp +++ clang/test/Parser/cxx-concept-declaration.cpp @@ -1,7 +1,14 @@ // Support parsing of concepts // Disabled for now. -// expected-no-diagnostics -// RUN: %clang_cc1 -std=c++14 -x c++ -verify %s -// template<typename T> concept C1 = true; +// RUN: %clang_cc1 -std=c++20 -x c++ -verify %s +template<typename T> concept C1 = true; + + + +template<class T> +concept C = true; + +template<class T> +class C<int> {}; //expected-error{{identifier followed by '<' indicates a class template specialization but 'C' refers to a concept template}} Index: clang/include/clang/Basic/DiagnosticParseKinds.td =================================================================== --- clang/include/clang/Basic/DiagnosticParseKinds.td +++ clang/include/clang/Basic/DiagnosticParseKinds.td @@ -775,7 +775,8 @@ def err_template_spec_syntax_non_template : Error< "identifier followed by '<' indicates a class template specialization but " "%0 %select{does not refer to a template|refers to a function template|" - "<unused>|refers to a variable template|<unused>|refers to a concept}1">; + "<unused>|refers to a variable template|<unused>|refers to a concept|" + "refers to a concept template}1">; def err_id_after_template_in_nested_name_spec : Error< "expected template name after 'template' keyword in nested name specifier">; def err_unexpected_template_in_unqualified_id : Error<
Index: clang/test/Parser/cxx-concept-declaration.cpp =================================================================== --- clang/test/Parser/cxx-concept-declaration.cpp +++ clang/test/Parser/cxx-concept-declaration.cpp @@ -1,7 +1,14 @@ // Support parsing of concepts // Disabled for now. -// expected-no-diagnostics -// RUN: %clang_cc1 -std=c++14 -x c++ -verify %s -// template<typename T> concept C1 = true; +// RUN: %clang_cc1 -std=c++20 -x c++ -verify %s +template<typename T> concept C1 = true; + + + +template<class T> +concept C = true; + +template<class T> +class C<int> {}; //expected-error{{identifier followed by '<' indicates a class template specialization but 'C' refers to a concept template}} Index: clang/include/clang/Basic/DiagnosticParseKinds.td =================================================================== --- clang/include/clang/Basic/DiagnosticParseKinds.td +++ clang/include/clang/Basic/DiagnosticParseKinds.td @@ -775,7 +775,8 @@ def err_template_spec_syntax_non_template : Error< "identifier followed by '<' indicates a class template specialization but " "%0 %select{does not refer to a template|refers to a function template|" - "<unused>|refers to a variable template|<unused>|refers to a concept}1">; + "<unused>|refers to a variable template|<unused>|refers to a concept|" + "refers to a concept template}1">; def err_id_after_template_in_nested_name_spec : Error< "expected template name after 'template' keyword in nested name specifier">; def err_unexpected_template_in_unqualified_id : Error<
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits