<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - error: instantiation of function required here, but no definition is available"
   href="https://llvm.org/bugs/show_bug.cgi?id=31379">31379</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>error: instantiation of function required here, but no definition is available
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>jdanek@redhat.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=17755" name="attach_17755" title="Reproducer file message.ii">attachment 17755</a> <a href="attachment.cgi?id=17755&action=edit" title="Reproducer file message.ii">[details]</a></span>
Reproducer file message.ii

I encountered the following error when building Apache Qpid Proton C++ binding
with latest clang 4.0 snapshot (from the apt repo)

I obtained the source in the following way
git clone <a href="https://github.com/apache/qpid-proton.git">https://github.com/apache/qpid-proton.git</a>
mkdir /qpid-proton/build
cd /qpid-proton/build
CC=clang-4.0 CXX=clang++-4.0 cmake -DCMAKE_BUILD_TYPE=Debug ..
VERBOSE=1 make

The erroring command was

cd /qpid-proton/build/proton-c/bindings/cpp && /usr/bin/clang++-4.0
-Dqpid_proton_cpp_EXPORTS -g -fPIC -I/qpid-proton/build/proton-c/src
-I/qpid-proton/build/proton-c/include -I/qpid-proton/proton-c/src
-I/qpid-proton/proton-c/include -I/qpid-proton/proton-c/bindings/cpp/include
-I/qpid-proton/proton-c/bindings/cpp/src/include -Werror -pedantic -Weverything
-Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-float-equal -Wno-padded
-Wno-sign-conversion -Wno-switch-enum -Wno-weak-vtables
-Wno-exit-time-destructors -Wno-global-constructors -Wno-shorten-64-to-32
-Wno-documentation -Wno-documentation-unknown-command -Wno-old-style-cast
-Wno-missing-noreturn -o CMakeFiles/qpid-proton-cpp.dir/src/message.cpp.o -c
/qpid-proton/proton-c/bindings/cpp/src/message.cpp
In file included from /qpid-proton/proton-c/bindings/cpp/src/message.cpp:25:
/qpid-proton/proton-c/bindings/cpp/include/proton/message.hpp:51:11: error:
instantiation of function
'proton::internal::cached_map<std::basic_string<char>,
proton::scalar>::cached_map' required here, but no definition is
available [-Werror,-Wundefined-func-template]
class property_map : public internal::cached_map<std::string, scalar> {};
^
/qpid-proton/proton-c/bindings/cpp/include/proton/./internal/cached_map.hpp:59:19:
note: forward declaration of template entity is here
PN_CPP_EXTERN cached_map();
^
1 error generated.

I reported this to Qpid Proton issue tracker, and got feedback that code looks
fine and it could be a compiller bug.
<a href="https://issues.apache.org/jira/browse/PROTON-1375?focusedCommentId=15749247#comment-15749247">https://issues.apache.org/jira/browse/PROTON-1375?focusedCommentId=15749247#comment-15749247</a>

I've followed the GCC bug reporting guide <a href="https://gcc.gnu.org/bugs/">https://gcc.gnu.org/bugs/</a> and ran the
above command with -save-temps

cd /qpid-proton/build/proton-c/bindings/cpp && /usr/bin/clang++-4.0
-Dqpid_proton_cpp_EXPORTS -g -fPIC -I/qpid-proton/build/proton-c/src
-I/qpid-proton/build/proton-c/include -I/qpid-proton/proton-c/src
-I/qpid-proton/proton-c/include -I/qpid-proton/proton-c/bindings/cpp/include
-I/qpid-proton/proton-c/bindings/cpp/src/include -Werror -pedantic -Weverything
-Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-float-equal -Wno-padded
-Wno-sign-conversion -Wno-switch-enum -Wno-weak-vtables
-Wno-exit-time-destructors -Wno-global-constructors -Wno-shorten-64-to-32
-Wno-documentation -Wno-documentation-unknown-command -Wno-old-style-cast
-Wno-missing-noreturn -o CMakeFiles/qpid-proton-cpp.dir/src/message.cpp.o -c
/qpid-proton/proton-c/bindings/cpp/src/message.cpp -save-temps

which created a single file reproducer message.ii, and I modified the clang
command to use message.ii, and this still fails, so I have a single file
reproducer

/usr/bin/clang++-4.0 -Dqpid_proton_cpp_EXPORTS -g -fPIC -Werror -pedantic
-Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-float-equal
-Wno-padded -Wno-sign-conversion -Wno-switch-enum -Wno-weak-vtables
-Wno-exit-time-destructors -Wno-global-constructors -Wno-shorten-64-to-32
-Wno-documentation -Wno-documentation-unknown-command -Wno-old-style-cast
-Wno-missing-noreturn message.ii

If I do the compilation with clang 3.9, I get the same error. If I compile
message.ii with gcc 5.4 (leaving out -Weverything parameter) the compilation
succeeds.

This message.ii file is attached. Thank you for looking into this.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>