Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-20515

Clang: function "X" with deduced return type cannot be used before it is defined

    XMLWordPrintable

Details

    Description

      main.cpp needs to be parsed in >= C++14 mode to reproduce:

      main.h

      template<typename T>
      decltype(auto) foo(T t)
      { return t; }
      

      main.cpp

      #include "main.h"
      
      int main()
      {
          foo(3); // error: function 'foo<int>' with deduced return type cannot be used before it is defined
      }
      

      Attachments

        Activity

          People

            kosjar Nikolai Kosjar
            kosjar Nikolai Kosjar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: