[llvm-bugs] [Bug 31379] New: error: instantiation of function required here, but no definition is available

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Dec 14 14:35:10 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=31379

            Bug ID: 31379
           Summary: error: instantiation of function required here, but no
                    definition is available
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jdanek at redhat.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 17755
  --> https://llvm.org/bugs/attachment.cgi?id=17755&action=edit
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 https://github.com/apache/qpid-proton.git
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.
https://issues.apache.org/jira/browse/PROTON-1375?focusedCommentId=15749247#comment-15749247

I've followed the GCC bug reporting guide https://gcc.gnu.org/bugs/ 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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20161214/29e28e60/attachment-0001.html>


More information about the llvm-bugs mailing list