- Jun 17, 2009
-
-
Douglas Gregor authored
thereof. Patch by Anders Johnsen! llvm-svn: 73641
-
- 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
-
- Jun 13, 2009
-
-
Douglas Gregor authored
Move a bunch of tests into temp.param, and write a few tests for paragraphs that hadn't been touched before llvm-svn: 73288
-
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
If a CXXRecordDecl is a class template, the 'this' type should be the injected class name type. Fixes pr4383. llvm-svn: 73284
-
Anders Carlsson authored
llvm-svn: 73281
-
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: 73267
-
Anders Carlsson authored
llvm-svn: 73262
-
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
-
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
-
Eli Friedman authored
llvm-svn: 73178
-
Douglas Gregor authored
Also, introduced some of the framework for performing instantiation as part of template argument deduction. llvm-svn: 73175
-
- Jun 10, 2009
-
-
Douglas Gregor authored
T::*) and implement template instantiation for member pointer types. llvm-svn: 73151
-
- Jun 09, 2009
-
-
Douglas Gregor authored
llvm-svn: 73147
-
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
-
- Jun 08, 2009
-
-
Anders Carlsson authored
llvm-svn: 73077
-
Douglas Gregor authored
llvm-svn: 73072
-
Anders Carlsson authored
llvm-svn: 73070
-
- Jun 07, 2009
-
-
Anders Carlsson authored
Instantiation support for more Obj-C expressions, string literals, @selector and @protocol expressions. llvm-svn: 73036
-
Anders Carlsson authored
llvm-svn: 73034
-
- Jun 05, 2009
-
-
Anders Carlsson authored
llvm-svn: 72913
-
Anders Carlsson authored
llvm-svn: 72911
-
Douglas Gregor authored
- Once we have deduced template arguments for a class template partial specialization, we use exactly those template arguments for instantiating the definition of the class template partial specialization. - Added template argument deduction for non-type template parameters. - Added template argument deduction for dependently-sized array types. With these changes, we can now implement, e.g., the remove_reference type trait. Also, Daniel's Ackermann template metaprogram now compiles properly. llvm-svn: 72909
-
- Jun 04, 2009
-
-
Anders Carlsson authored
llvm-svn: 72844
-
Douglas Gregor authored
llvm-svn: 72822
-
Douglas Gregor authored
deductions of the same template parameter are equivalent. This allows us to implement the is_same type trait (!). Also, move template argument deduction into its own file and update a few build systems with this change (grrrr). llvm-svn: 72819
-
- Jun 03, 2009
-
-
Argyrios Kyrtzidis authored
llvm-svn: 72747
-
- Jun 01, 2009
-
-
Anders Carlsson authored
After spending 15 minutes trying to figure out why this was crashing, I realized it was a bug in the test case :) llvm-svn: 72680
-
- May 31, 2009
-
-
Douglas Gregor authored
we have the basics of declaring and storing class template partial specializations, matching class template partial specializations at instantiation time via (limited) template argument deduction, and using the class template partial specialization's pattern for instantiation. This patch is enough to make a simple is_pointer type trait work, but not much else. llvm-svn: 72662
-
- May 29, 2009
-
-
Douglas Gregor authored
printing logic to help customize the output. For now, we use this rather than a special flag to suppress the "struct" when printing "struct X" and to print the Boolean type as "bool" in C++ but "_Bool" in C. llvm-svn: 72590
-