Giter VIP home page Giter VIP logo

Comments (11)

mody avatar mody commented on August 27, 2024 1

I got compiler errors, seems like the llvm.org clang 3.5.0-1~exp1 version is incomplete. I'll try Debian Jessie with different clang++ 3.5 package later.

$ CXX=clang++ CC=clang make -j1 test
make -C ./tests/ test
make[1]: Entering directory `/home/patrik/work/sklik/SuperiorMySqlpp/tests'
clang++ -std=c++1y -pedantic-errors -Wall -Wextra -Wswitch-enum -Wnarrowing -DHAVE_CLANG -Werror -fPIC -fsanitize=address -fsanitize=leak -fsanitize=undefined -g3 -I../include/ -I../third_party/bandit/ -DDEBUG -O0 -c -MMD -o converters/converters.o converters/converters.cpp
In file included from converters/converters.cpp:8:
In file included from ../include/superior_mysqlpp/converters.hpp:10:
../include/superior_mysqlpp/converters/to_integer.hpp:253:17: error: no template named 'enable_if_t' in namespace 'std'; did you mean 'enable_if'?
    inline std::enable_if_t<std::is_unsigned<T>::value, T> toInteger(const char* str, unsigned int length)
           ~~~~~^~~~~~~~~~~
                enable_if

from superiormysqlpp.

mody avatar mody commented on August 27, 2024 1

With

$ clang++-3.5 --version
Debian clang version 3.5.0-10 (tags/RELEASE_350/final) (based on LLVM 3.5.0)
Target: x86_64-pc-linux-gnu
Thread model: posix

I get simillar error you reported:

$ CXX=clang++-3.5 CC=clang-3.5 make -j1 test
make -C ./tests/ test
make[1]: Entering directory '/home/patrik/work/sklik/SuperiorMySqlpp/tests'
clang++-3.5 -std=c++14 -pedantic-errors -Wall -Wextra -Wswitch-enum -Wnarrowing -DHAVE_CLANG -Werror -fPIC -fsanitize=address -fsanitize=leak -fsanitize=undefined -g3 -I../include/ -I../third_party/bandit/ -DDEBUG -O0 -c -MMD -o converters/converters.o converters/converters.cpp
In file included from converters/converters.cpp:8:
In file included from ../include/superior_mysqlpp/converters.hpp:11:
../include/superior_mysqlpp/converters/to_floating_point.hpp:27:18: error: inline declaration of 'toFloatingPoint<float>' follows non-inline definition
    inline float toFloatingPoint(const char* str, std::size_t length)
                 ^
../include/superior_mysqlpp/converters/to_floating_point.hpp:27:18: note: previous definition is here
../include/superior_mysqlpp/converters/to_floating_point.hpp:37:19: error: inline declaration of 'toFloatingPoint<double>' follows non-inline definition
    inline double toFloatingPoint(const char* str, std::size_t length)
                  ^
../include/superior_mysqlpp/converters/to_floating_point.hpp:37:19: note: previous definition is here
../include/superior_mysqlpp/converters/to_floating_point.hpp:47:24: error: inline declaration of 'toFloatingPoint<long double>' follows non-inline definition
    inline long double toFloatingPoint(const char* str, std::size_t length)
                       ^
../include/superior_mysqlpp/converters/to_floating_point.hpp:47:24: note: previous definition is here
3 errors generated.
makefile:101: recipe for target 'converters/converters.o' failed

But it doesn't make sense to me. I need more time.

from superiormysqlpp.

mody avatar mody commented on August 27, 2024

from superiormysqlpp.

daniele77 avatar daniele77 commented on August 27, 2024

According to clang C++ support page, Clang 3.4 and later impolement all of the ISO C++ 2014 standard.
Of course, I compiled with the appropriate flag to ensure c++14 was enabled.
I hope you can fix this because e.g., debian stable distros come with an old clang package.

from superiormysqlpp.

mody avatar mody commented on August 27, 2024

I tried compiling the library itself using:

Debian clang version 3.5.0-1~exp1 (trunk) (based on LLVM 3.5.0)
Target: x86_64-pc-linux-gnu
Thread model: posix

from

$ apt-cache policy clang-3.5
clang-3.5:
  Installed: 1:3.5~svn212963-1~exp1
  Candidate: 1:3.5~svn212963-1~exp1
  Version table:
 *** 1:3.5~svn212963-1~exp1 0
        500 http://llvm.org/apt/wheezy/ llvm-toolchain-wheezy/main amd64 Packages
        100 /var/lib/dpkg/status

And it fails on

error: invalid value 'c++14' in '-std=c++14'

So it seems, that clang 3.5.x doesn't support required C++14 or the precompiled packages provided by llvm.org are from some really old branch.

from superiormysqlpp.

daniele77 avatar daniele77 commented on August 27, 2024

Are you sure you're compiling using clang++ and not clang by mistake?

I'm compiling with:

Debian clang version 3.5.0-10 (tags/RELEASE_350/final) (based on LLVM 3.5.0)
Target: i386-pc-linux-gnu
Thread model: posix

and the flag -std=c++14 is correctly supported. Exactly as indicated in this page:
https://clang.llvm.org/cxx_status.html

C++14 implementation status

Clang 3.4 and later implement all of the ISO C++ 2014 standard.

You can use Clang in C++14 mode with the -std=c++14 option (use -std=c++1y in Clang 3.4 and earlier).

from superiormysqlpp.

mody avatar mody commented on August 27, 2024

This is what I get:

$ clang++ -std=c++14 tests/uncaught_exception_counter.cpp 
error: invalid value 'c++14' in '-std=c++14'
$ clang++ --version
Debian clang version 3.5.0-1~exp1 (trunk) (based on LLVM 3.5.0)
Target: x86_64-pc-linux-gnu
Thread model: posix

from superiormysqlpp.

daniele77 avatar daniele77 commented on August 27, 2024

I think the version 3.5.0-1~exp1 (trunk) is not tagged in the repository, maybe has got some issue with the flag.
Could you please try with -std=c++1y, instead? It should be the same that -std=c++14.
Thanks

from superiormysqlpp.

daniele77 avatar daniele77 commented on August 27, 2024

Thanks. I'll try to help in my (few) spare time

from superiormysqlpp.

mody avatar mody commented on August 27, 2024

I finally found something but it's not a good news: Specialized template function with deleted “general” case fails to compile with g++ <=4.8.0 and clang++

Looks like the clang++ << 3.9.0 implemented C++14 draft, that was later polished so later versions of clang accept current source. I'm affraid this won't be fixed.

from superiormysqlpp.

daniele77 avatar daniele77 commented on August 27, 2024

Thanks anyway.
At least I learned that clang I'm using has not got that feature :-)
I'll try to install a more recent version of clang: I read that multiple version can cohexist on Debian so I hope it won't be a big deal.
Thanks again.

from superiormysqlpp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.