- Jun 14, 2009
-
-
Douglas Gregor authored
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
-
Chris Lattner authored
preprocessor and initialize it early in clang-cc. This ensures that __has_builtin works in all modes, not just when ASTContext is around. llvm-svn: 73319
-
Chris Lattner authored
llvm-svn: 73316
-
- Jun 13, 2009
-
-
Anders Carlsson authored
Have CheckClassTemplatePartialSpecializationArgs take a TemplateArgumentListBuilder. No functionality change. llvm-svn: 73297
-
Eli Friedman authored
of the elements. Issue reported on cfe-dev by Mattias Holm. llvm-svn: 73292
-
Eli Friedman authored
I'm not completely sure this is the right way to fix this issue, but it seems reasonable, and it's consistent with the non-template code for this construct. llvm-svn: 73285
-
Anders Carlsson authored
llvm-svn: 73281
-
Douglas Gregor authored
obviously written by someone who didn't read C++ [temp.class.spec]. llvm-svn: 73276
-
Anders Carlsson authored
llvm-svn: 73275
-
Douglas Gregor authored
specialization cannot be deduced, produce a warning noting that the affected class template partial specialization will never be used. llvm-svn: 73274
-
Anders Carlsson authored
llvm-svn: 73269
-
Anders Carlsson authored
llvm-svn: 73268
-
Chris Lattner authored
This fixes a source range problem reported by Olaf Krzikalla. llvm-svn: 73266
-
Anders Carlsson authored
llvm-svn: 73264
-
Douglas Gregor authored
It looks like we've finished off matching of class template partial specializations; add comments and update the C++ status page llvm-svn: 73263
-
Anders Carlsson authored
llvm-svn: 73262
-
Anders Carlsson authored
llvm-svn: 73261
-
Douglas Gregor authored
llvm-svn: 73260
-
Douglas Gregor authored
specialization's arguments are identical to the implicit template arguments of the primary template. Typically, this is meant to be a declaration/definition of the primary template, so we give that advice. llvm-svn: 73259
-
- Jun 12, 2009
-
-
Douglas Gregor authored
template partial specializations. llvm-svn: 73254
-
Anders Carlsson authored
llvm-svn: 73247
-
Douglas Gregor authored
specialization do not have default arguments (C++ [temp.class.spec]p10). llvm-svn: 73245
-
Anders Carlsson authored
llvm-svn: 73240
-
Douglas Gregor authored
argument deduction failed. For example, given template<typename T> struct is_same<T, T> { ... }; template argument deduction will fail for is_same<int, float>, and now reports enough information Right now, we don't do anything with this extra information, but it can be used for informative diagnostics that say, e.g., "template argument deduction failed because T was deduced to 'int' in one context and 'float' in another". llvm-svn: 73237
-
Anders Carlsson authored
It's an error to use a function declared in a class definition as a default argument before the function has been declared. llvm-svn: 73234
-
Anders Carlsson authored
llvm-svn: 73232
-
- Jun 11, 2009
-
-
Douglas Gregor authored
partial specialization, substitute those template arguments back into the template arguments of the class template partial specialization to see if the results still match the original template arguments. This code is more general than it needs to be, since we don't yet diagnose C++ [temp.class.spec]p9. However, it's likely to be needed for function templates. llvm-svn: 73196
-
Anders Carlsson authored
Add a null check that fixes the crash in PR4362, and make sure to instantiate non-type template arguments. llvm-svn: 73193
-
Eli Friedman authored
(Actually, this isn't precisely correct, but it doesn't make sense to query whether an expression that isn't an ICE is value-dependent anyway.) llvm-svn: 73179
-
Douglas Gregor authored
llvm-svn: 73176
-
Douglas Gregor authored
Also, introduced some of the framework for performing instantiation as part of template argument deduction. llvm-svn: 73175
-
- Jun 10, 2009
-
-
Eli Friedman authored
visible anywhere normally because the printf format checks for this case, and we don't print out attribute values anywhere. Original patch by Roberto Bagnara. llvm-svn: 73157
-
Douglas Gregor authored
T::*) and implement template instantiation for member pointer types. llvm-svn: 73151
-
- Jun 09, 2009
-
-
Douglas Gregor authored
specialization types. As the example shows, we can now compute the length of a type-list using a template metaprogram and class template partial specialization. llvm-svn: 73136
-
Eli Friedman authored
llvm-svn: 73101
-
- Jun 08, 2009
-
-
Anders Carlsson authored
llvm-svn: 73077
-
Douglas Gregor authored
llvm-svn: 73071
-
Anders Carlsson authored
llvm-svn: 73070
-
Eli Friedman authored
llvm-svn: 73043
-
Eli Friedman authored
hack which introduces some strange inconsistencies in compatibility for block pointers. Note that unlike an earlier revision proposed on cfe-commits, this patch still allows declaring block pointers without a prototype. llvm-svn: 73041
-