This revision was automatically updated to reflect the committed changes.
Closed by commit rL373862: [Sema] Avoids an assertion failure when an invalid
conversion declaration is… (authored by rsmith, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D64820?vs=218213&id=223434#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D64820/new/
https://reviews.llvm.org/D64820
Files:
cfe/trunk/lib/Sema/SemaDecl.cpp
cfe/trunk/test/SemaCXX/PR31422.cpp
Index: cfe/trunk/test/SemaCXX/PR31422.cpp
===================================================================
--- cfe/trunk/test/SemaCXX/PR31422.cpp
+++ cfe/trunk/test/SemaCXX/PR31422.cpp
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -std=c++14 -fsyntax-only -verify %s
+
+// expected-error@+3 {{cannot specify any part of a return type in the
declaration of a conversion function; use an alias template to declare a
conversion to 'auto (Ts &&...) const'}}
+// expected-error@+2 {{conversion function cannot convert to a function type}}
+struct S {
+ template <typename... Ts> operator auto()(Ts &&... xs) const;
+};
Index: cfe/trunk/lib/Sema/SemaDecl.cpp
===================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp
+++ cfe/trunk/lib/Sema/SemaDecl.cpp
@@ -8206,6 +8206,9 @@
}
SemaRef.CheckConversionDeclarator(D, R, SC);
+ if (D.isInvalidType())
+ return nullptr;
+
IsVirtualOkay = true;
return CXXConversionDecl::Create(
SemaRef.Context, cast<CXXRecordDecl>(DC), D.getBeginLoc(), NameInfo, R,
Index: cfe/trunk/test/SemaCXX/PR31422.cpp
===================================================================
--- cfe/trunk/test/SemaCXX/PR31422.cpp
+++ cfe/trunk/test/SemaCXX/PR31422.cpp
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -std=c++14 -fsyntax-only -verify %s
+
+// expected-error@+3 {{cannot specify any part of a return type in the declaration of a conversion function; use an alias template to declare a conversion to 'auto (Ts &&...) const'}}
+// expected-error@+2 {{conversion function cannot convert to a function type}}
+struct S {
+ template <typename... Ts> operator auto()(Ts &&... xs) const;
+};
Index: cfe/trunk/lib/Sema/SemaDecl.cpp
===================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp
+++ cfe/trunk/lib/Sema/SemaDecl.cpp
@@ -8206,6 +8206,9 @@
}
SemaRef.CheckConversionDeclarator(D, R, SC);
+ if (D.isInvalidType())
+ return nullptr;
+
IsVirtualOkay = true;
return CXXConversionDecl::Create(
SemaRef.Context, cast<CXXRecordDecl>(DC), D.getBeginLoc(), NameInfo, R,
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits