http://llvm.org/bugs/show_bug.cgi?id=10405

           Summary: Missing actual type in error message when using
                    decltype as a template parameter
           Product: clang
           Version: trunk
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Keywords: quality-of-implementation
          Severity: normal
          Priority: P
         Component: C++0x
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


The following program intentionally does not compile:

template <typename>
struct Foo { };

template <typename T, typename U>
auto foo(T t, U u) -> Foo<decltype(t + u)>;

int main(int, char**)
{
  int i = foo(1, 2);
}


With clang r135379, this results in the following message:

$ clang -std=c++0x clang.cpp 
clang.cpp:9:6: error: no viable conversion from 'Foo<decltype(t + u)>' to 'int'
        int i = foo(1, 2);
            ^   ~~~~~~~~~
1 error generated.


It would be helpful, if clang displayed the actual type here, just as it does
with template parameters in many other situations. In this case, the message
should read:

  no viable conversion from 'Foo<decltype(t + u)>' (aka 'Foo<int>') to 'int'

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to