clang

Private member access in template substitution and SFINAE

橙三吉。 提交于 2021-02-08 12:19:11
问题 class A { int a; }; template<typename, typename = void> class test {}; template<typename T> class test<T,decltype(T::a)> {}; int main() { test<A> a; } The code above compiles without error on clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final) , but fails to compile on g++-5 (Ubuntu 5.4.1-2ubuntu1~16.04) 5.4.1 20160904 and g++-6 (Ubuntu 6.2.0-3ubuntu11~16.04) 6.2.0 20160901 with errors like this: main.cpp: In function ‘int main()’: main.cpp:9:22: error: ‘int A::a’ is private within this

京东App Swift 混编及组件化落地

陌路散爱 提交于 2021-02-08 12:02:16
背景 自 Swift 诞生以来,逐步见证其从饱受诟病到日渐完善。在苹果的全力推动下,潜移默化地把开发支持中心从 Objective-C 转向 Swift,在业界的呼声也越演越烈。当我们相继迎来 ABI稳定、Module stability、Library evolution 等功能后,我们期盼已久的 Swift 已然到来,毅然启动了京东 App 的混编之旅。我们依然坚持稳扎稳打,前期对 Swift 技术做了诸多调研工作,具体可见 《Swift环境及编译优化调研》 。2020年7月京东 App 的首个混编版本上线苹果商店,完成了组件内和主工程的混编工作;近期,我们完成了对京东组件化管理工具(iBiuTool)的改造,混编组件化功能正式落地,这也标志着京东 Swift 混编基础支持建设完毕。但是,Just the beginning... 期待的Swift已经到来 2.1 ABI稳定 Swift 5.0,提供 ABI 稳定,解决了 Swift runtime 的版本兼容问题。这意味着通过 Swift 5.0 及以上的编译器编译出来的二进制,就可以运行在任意 Swift 5.0 及以上的 Swift runtime 上。ABI 稳定后,Swift runtime 和标准库已经植入 macOS 10.14.4、iOS 12.2、watchOS 5.2 及以上系统中。根据苹果官方数据,截止到

Error install RcppArmadillo on macOS Catalina [duplicate]

岁酱吖の 提交于 2021-02-08 11:10:38
问题 This question already has answers here : Cannot compile R packages with c++ code after updating to macOS Catalina (2 answers) Closed 1 year ago . I followed the steps in R Compiler Tools for Rcpp on macOS (for R 3.6.x), but an error occurs when I try to install RcppArmadillo . I don't have Xcode.app install, and prefer to use the command line tools instead. The answers posted here didn't help :( * installing *source* package ‘RcppArmadillo’ ... ** package ‘RcppArmadillo’ successfully unpacked

Error install RcppArmadillo on macOS Catalina [duplicate]

。_饼干妹妹 提交于 2021-02-08 11:06:08
问题 This question already has answers here : Cannot compile R packages with c++ code after updating to macOS Catalina (2 answers) Closed 1 year ago . I followed the steps in R Compiler Tools for Rcpp on macOS (for R 3.6.x), but an error occurs when I try to install RcppArmadillo . I don't have Xcode.app install, and prefer to use the command line tools instead. The answers posted here didn't help :( * installing *source* package ‘RcppArmadillo’ ... ** package ‘RcppArmadillo’ successfully unpacked

ANY possible way to run the clang compiler from a Sandboxed app?

邮差的信 提交于 2021-02-08 06:31:24
问题 OK, the question is fairly straightforward. I have a sandboxed OSX app. I want the user to be able to compile some C code (whatever he inputs). But whenever I'm attempting a call to: /usr/bin/env clang /the/path/to/the/source.c I'm getting the following error in the logs: xcrun: error: cannot be used within an App Sandbox. Is there any way to circumvent this? P.S. I've successfully done pretty much the same thing with Ruby, Python and PHP. 回答1: If you want to keep your app sandboxed you could

What's going on with clang's include priorities?

送分小仙女□ 提交于 2021-02-07 19:36:24
问题 My command: /usr/bin/c++ -fPIC -I/Users/me/project/include -I/usr/local/include/opencv \ -I/usr/local/include -I/opt/local/include -std=c++11 -O3 -M -c \ /Users/me/project/src/program.cpp | grep opencv program.cpp has: #include "opencv2/core/core.hpp" #include "opencv2/ml/ml.hpp" Output: /opt/local/include/opencv2/core/core.hpp \ /opt/local/include/opencv2/core/types_c.h /usr/include/assert.h \ /usr/include/math.h /opt/local/include/opencv2/core/version.hpp \ /opt/local/include/opencv2/core

How to specify a custom stdlib directory for LLVM

懵懂的女人 提交于 2021-02-07 14:22:23
问题 I have LLVM 3.3 with Clang, and $ /tmp/clang/bin/clang -print-search-dirs programs: =/tmp/clang/bin:/usr/lib/gcc/i486-linux-gnu/4.4/../../../../i486-linux-gnu/bin libraries: =/tmp/clang/bin/../lib/clang/3.3:/usr/lib/gcc/i486-linux-gnu/4.4:/usr/lib/gcc/i486-linux-gnu/4.4/../../../../lib32:/usr/lib/../lib32:/usr/lib/i486-linux-gnu/../../lib32:/usr/lib/gcc/i486-linux-gnu/4.4/../../..:/lib:/usr/lib How can I instruct Clang to usage an stdlib (e.g. libgcc ) directory other than /usr/lib/gcc/i486

How to specify a custom stdlib directory for LLVM

家住魔仙堡 提交于 2021-02-07 14:22:18
问题 I have LLVM 3.3 with Clang, and $ /tmp/clang/bin/clang -print-search-dirs programs: =/tmp/clang/bin:/usr/lib/gcc/i486-linux-gnu/4.4/../../../../i486-linux-gnu/bin libraries: =/tmp/clang/bin/../lib/clang/3.3:/usr/lib/gcc/i486-linux-gnu/4.4:/usr/lib/gcc/i486-linux-gnu/4.4/../../../../lib32:/usr/lib/../lib32:/usr/lib/i486-linux-gnu/../../lib32:/usr/lib/gcc/i486-linux-gnu/4.4/../../..:/lib:/usr/lib How can I instruct Clang to usage an stdlib (e.g. libgcc ) directory other than /usr/lib/gcc/i486

Force LP64 data model with GCC or Clang in Windows

爱⌒轻易说出口 提交于 2021-02-07 13:38:48
问题 Is there a way to force GCC and/or Clang compiler to use LP64 data model when targeting Windows (ignoring that Windows use LLP64 data model)? 回答1: No, because the requested capability would not work You are "targeting Windows", presumably meaning you want the compiler to produce code that will run under Windows in the usual way. In order to do that, the program must invoke functions in the Windows API. There are effectively three versions of the Windows API: win16, win32, and win64. Since you

Force LP64 data model with GCC or Clang in Windows

一世执手 提交于 2021-02-07 13:38:41
问题 Is there a way to force GCC and/or Clang compiler to use LP64 data model when targeting Windows (ignoring that Windows use LLP64 data model)? 回答1: No, because the requested capability would not work You are "targeting Windows", presumably meaning you want the compiler to produce code that will run under Windows in the usual way. In order to do that, the program must invoke functions in the Windows API. There are effectively three versions of the Windows API: win16, win32, and win64. Since you