From ad17dd16e8c0be602c8751cdc8ada0903f642ee0 Mon Sep 17 00:00:00 2001 From: Pierre Rossi <pierre.rossi@theqtcompany.com> Date: Thu, 12 Feb 2015 13:13:37 +0100 Subject: [PATCH] Compile time check the fileListingHelper specializations Since we can now rely on deleted functions (supported by MSVC 2013), we can avoid the scenario we had with the last snapshot update where the file picker internal API changed slightly (see 1a744ca4 for more details). Change-Id: Iab26a7834a367f24afe5fbf37fae64639aa9c12e Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com> --- src/core/type_conversion.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/core/type_conversion.h b/src/core/type_conversion.h index 6bb755abc..619a3b9ba 100644 --- a/src/core/type_conversion.h +++ b/src/core/type_conversion.h @@ -155,7 +155,14 @@ inline base::FilePath toFilePath(const QString &str) } template <typename T> -inline T fileListingHelper(const QString &) {qFatal("Specialization missing for %s.", Q_FUNC_INFO); return T(); } +inline T fileListingHelper(const QString &) +// Clang is still picky about this though it should be supported eventually. +// See http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#941 +#ifndef Q_CC_CLANG += delete; +#else +{ return T(); } +#endif template <> inline content::FileChooserFileInfo fileListingHelper<content::FileChooserFileInfo>(const QString &file) -- GitLab