summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/temp_class_spec.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-06-14 07:33:30 +0000
committerDouglas Gregor <dgregor@apple.com>2009-06-14 07:33:30 +0000
commit33834516f361dfb3e52c6ca71336adaf45b1d65e (patch)
tree011ebd5769fbc3add089d73563db4235508b0c7a /clang/test/SemaTemplate/temp_class_spec.cpp
parentec131d1fd72649928a3290d8189f6321ebfdc36c (diff)
downloadbcm5719-llvm-33834516f361dfb3e52c6ca71336adaf45b1d65e.tar.gz
bcm5719-llvm-33834516f361dfb3e52c6ca71336adaf45b1d65e.zip
Update LLVM.
Implement support for C++ Substitution Failure Is Not An Error (SFINAE), which says that errors that occur during template argument deduction do *not* produce diagnostics and do not necessarily make a program ill-formed. Instead, template argument deduction silently fails. This is currently implemented for template argument deduction during matching of class template partial specializations, although the mechanism will also apply to template argument deduction for function templates. The scheme is simple: - If we are in a template argument deduction context, any diagnostic that is considered a SFINAE error (or warning) will be suppressed. The error will be propagated up the call stack via the normal means. - By default, all warnings and errors are SFINAE errors. Add the NoSFINAE class to a diagnostic in the .td file to make it a hard error (e.g., for access-control violations). Note that, to make this fully work, every place in Sema that emits an error *and then immediately recovers* will need to check Sema::isSFINAEContext() to determine whether it must immediately return an error rather than recovering. llvm-svn: 73332
Diffstat (limited to 'clang/test/SemaTemplate/temp_class_spec.cpp')
-rw-r--r--clang/test/SemaTemplate/temp_class_spec.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/test/SemaTemplate/temp_class_spec.cpp b/clang/test/SemaTemplate/temp_class_spec.cpp
index 6fedce76ae0..1a534236c8e 100644
--- a/clang/test/SemaTemplate/temp_class_spec.cpp
+++ b/clang/test/SemaTemplate/temp_class_spec.cpp
@@ -251,9 +251,8 @@ int is_nested_value_type_identity0[
is_nested_value_type_identity<HasValueType<int> >::value? -1 : 1];
int is_nested_value_type_identity1[
is_nested_value_type_identity<HasIdentityValueType>::value? 1 : -1];
-// FIXME: Enable when we have SFINAE support
-//int is_nested_value_type_identity2[
-// is_nested_value_type_identity<NoValueType>::value? -1 : 1];
+int is_nested_value_type_identity2[
+ is_nested_value_type_identity<NoValueType>::value? -1 : 1];
// C++ [temp.class.spec]p4:
OpenPOWER on IntegriCloud