[cfe-commits] r77928 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaOverload.cpp

Douglas Gregor dgregor at apple.com
Sun Aug 2 16:46:29 PDT 2009


Author: dgregor
Date: Sun Aug  2 18:46:29 2009
New Revision: 77928

URL: http://llvm.org/viewvc/llvm-project?rev=77928&view=rev
Log:
Produce a warning that partial ordering of function templates is not yet supported

Modified:
    cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
    cfe/trunk/lib/Sema/SemaOverload.cpp

Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=77928&r1=77927&r2=77928&view=diff

==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Sun Aug  2 18:46:29 2009
@@ -905,6 +905,10 @@
   "partial ordering of class template partial specializations is not yet "
   "supported">;
 
+def unsup_function_template_partial_ordering : Warning<
+  "partial ordering of function templates is unsupported; overload resolution "
+  "may result in an ambiguity that would not occur with a conforming compiler">;
+  
 // C++ Template Instantiation
 def err_template_recursion_depth_exceeded : Error<
   "recursive template instantiation exceeded maximum depth of %0">,

Modified: cfe/trunk/lib/Sema/SemaOverload.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOverload.cpp?rev=77928&r1=77927&r2=77928&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaOverload.cpp (original)
+++ cfe/trunk/lib/Sema/SemaOverload.cpp Sun Aug  2 18:46:29 2009
@@ -3496,8 +3496,10 @@
   //      template for F1 is more specialized than the template for F2 
   //      according to the partial ordering rules described in 14.5.5.2, or, 
   //      if not that,
-  
-  // FIXME: Implement partial ordering of function templates.
+  if (Cand1.Function && Cand1.Function->getPrimaryTemplate() &&
+      Cand2.Function && Cand2.Function->getPrimaryTemplate())
+    // FIXME: Implement partial ordering of function templates.
+    Diag(SourceLocation(), diag::unsup_function_template_partial_ordering);
 
   //   -- the context is an initialization by user-defined conversion
   //      (see 8.5, 13.3.1.5) and the standard conversion sequence





More information about the cfe-commits mailing list