diff options
| author | Douglas Gregor <dgregor@apple.com> | 2009-08-02 23:46:29 +0000 | 
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2009-08-02 23:46:29 +0000 | 
| commit | 55137cbc859e495d873a0d82c2d8045018631acb (patch) | |
| tree | 699d068e1c81d0a6a5e2fd807543df229b97c8f5 /clang | |
| parent | c3719c36e61f6ac28fc1e12587131bcae6581671 (diff) | |
| download | bcm5719-llvm-55137cbc859e495d873a0d82c2d8045018631acb.tar.gz bcm5719-llvm-55137cbc859e495d873a0d82c2d8045018631acb.zip  | |
Produce a warning that partial ordering of function templates is not yet supported
llvm-svn: 77928
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/include/clang/Basic/DiagnosticSemaKinds.td | 4 | ||||
| -rw-r--r-- | clang/lib/Sema/SemaOverload.cpp | 6 | 
2 files changed, 8 insertions, 2 deletions
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index 25e331721ae..a4e8f569547 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -905,6 +905,10 @@ def unsup_template_partial_spec_ordering : Error<    "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">, diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp index 0880d1073d6..75ca531cbcd 100644 --- a/clang/lib/Sema/SemaOverload.cpp +++ b/clang/lib/Sema/SemaOverload.cpp @@ -3496,8 +3496,10 @@ Sema::isBetterOverloadCandidate(const OverloadCandidate& Cand1,    //      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  | 

