r330798 - [NFC] Make dependent parameter non-deducible, so that we are forced to use the default template parameter.
Faisal Vali via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 24 20:54:20 PDT 2018
Author: faisalv
Date: Tue Apr 24 20:54:20 2018
New Revision: 330798
URL: http://llvm.org/viewvc/llvm-project?rev=330798&view=rev
Log:
[NFC] Make dependent parameter non-deducible, so that we are forced to use the default template parameter.
This might provide users with more graceful diagnostics if they should ever try and call this function with non-ConceptDecls.
Modified:
cfe/trunk/include/clang/Sema/DeclSpec.h
Modified: cfe/trunk/include/clang/Sema/DeclSpec.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/DeclSpec.h?rev=330798&r1=330797&r2=330798&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/DeclSpec.h (original)
+++ cfe/trunk/include/clang/Sema/DeclSpec.h Tue Apr 24 20:54:20 2018
@@ -699,7 +699,8 @@ public:
// This function can only be instantiated with ConceptDecl. We made it a
// template so that ConceptDecl only has to be defined where this is called.
template <class ConceptDeclTy = ConceptDecl>
- void setConceptRep(ConceptDeclTy *Rep) {
+ void
+ setConceptRep(typename llvm::identity<ConceptDeclTy>::argument_type *Rep) {
static_assert(std::is_same<ConceptDeclTy, ConceptDecl>::value,
"Must only be instantiated with ConceptDecl");
assert(isConceptSpecified() && "DeclSpec does not store a concept");
More information about the cfe-commits
mailing list