草庐IT

bugs-features

全部标签

c++ - static_assert 无法将 const char* 模板参数识别为 constexpr : g++ bug?

考虑以下定义。charright_string[]="::right_one.";charwrong_string[]="::wrong_one.";templatevoidf(){static_assert(str==::right_string,"Passme::right_string!");}structTest{staticconstexprcharright_string[]="template_struct::right_one";staticconstexprcharwrong_string[]="template_struct::wrong_one";template

c++ - 是可调用和模糊调用 : bug in either g++ or clang

考虑以下代码://Preamble#include#include//Abaseclasstemplatestructbase{voidoperator()(T){};};//Twoderivedclassesinheritingfromthesamebaseclassestemplatestructderived1:base...{usingbase::operator()...;};templatestructderived2:base...{usingbase::operator()...;};//Aclassinheritingfrombothderived1andderive

c++ - 嵌套类上的 RTTI,VS Bug?

以下代码输出:structProperty::IValue但我希望它输出:structProperty::Value代码:structIProperty{virtual~IProperty()=0;};IProperty::~IProperty(){}templatestructProperty:IProperty{structIValue{virtual~IValue()=0;};templatestructValue:IValue{Qthing;};Property():m_pValue(newValue()){}std::shared_ptrm_pValue;};template

开发避坑3——大鸟 pk Bug(使用postman测试POST接口遇到报错(ErrorMessage:Unauthorization request ......))

使用postman测试POST接口遇到报错(ErrorMessage:Unauthorizationrequest…)不管你是前端、后端、测试还是运维等工程师,学会使用postman测试接口是工作中必不可少的。当我们使用前端页面调用接口发现浏览器报错我们就要排查是前端调用问题还是后端接口返回值问题,用postman测试能提升我们的测试效率。我是侧重后端的全栈开发工程师,为大家分享一下我解决该报错的解决方法。postman测试工具的下载地址:https://www.postman.com/downloads/一、postman测接口报错“401未授权的请求”的原因因为我们该系统是必须要登录成功之

c++ - 函数模板修改用顶级 const 声明的参数 : clang bug?

下面的代码可以在ArchLinux上的clang3.8.1-1上正确编译。这是clang错误吗?gcc对此发出正确的警告/错误。templatestructBugReproducer{usingsize_type=typenameT::size_type;intbug1(size_typecount);intbug2(size_typecount)const;staticintbug3(size_typecount);};templateintBugReproducer::bug1(size_typeconstcount){//thisisabug.mustbenotallowedco

c++ - 铿锵错误 : non-type template argument refers to function that does not have linkage -- bug?

我有一些非常简单的(C++11)代码,最新的clang(version3.4trunk187493)无法编译,但GCC编译正常。代码(下面)实例化函数模板foo使用局部函数类型Bar然后尝试将其地址用作类模板Func的非类型模板参数:templatestructFunc{};templateexterninlinevoidfoo(){usingFoo=Func>;}intmain(){structBar{};//function-localtypefoo();return0;}clang发出以下错误:error:non-typetemplateargumentreferstofunct

c++ - 带有 decltype : bug in clang or gcc? 的 sfinae

Clang-3.2可以编译并且代码按预期运行:structhave_f{intf(inti){return10;}};structempty{};templatestructouter{Tt;//ifThavef(),defineouter_f()templateintouter_f(inti){returnt.f(i);}};intmain(){outero1;outero2;//tosilenceunusedvarwarningreturno1.outer_f(10)+sizeof(o2);}任何版本的GCC拒绝:t.cc:13:6:error:‘structempty’hasno

c++ - lambda : GCC bug and/or Clang bug? 中捕获变量的 decltype()

我检查了GCCbuglist和Clangbuglist并且还没有看到任何相关内容。ThisWandboxlink显示一些C++11/C++14代码为各种类型的x执行decltype(x)和decltype((x))被lambda捕获。GCC和Clang对这段代码给出了不同的答案。如果有的话,哪一个是正确的?这是有问题的片段://insidemain()inti=42;int&j=i;[j=j](){static_assert(std::is_same::value,"");//Astatic_assert(std::is_same::value,"");//B}();[=](){sta

windows - Powershell - 如何使用 Get-WindowsOptionalFeature 命令到 "Turn Windows Features On and Off"

在Windows10中,您可以在控制面板中“打开和关闭Windows功能”;您会看到这样的屏幕:假设我想通过在powershell中使用Enable-WindowsOptionalFeature命令来选择IIS6WMICompatibility。如果我运行:Get-WindowsOptionalFeature“IIS6WMI兼容性”我收到这个错误:Get-WindowsOptionalFeature:Apositionalparametercannotbefoundthatacceptsargument'IIS6WMICompatibility'.Atline:1char:1+Get-

c++ - 这是ntoskrnl.exe中tolower实现的大bug吗?

以下代码在用户模式下运行良好:#include#includeintmain(){////0x7f51istheunicodecodeofChinesecharacter'网'//intn=tolower(0x7f51);//nwillequal0x7f51}但是,如果我们处于内核模式,n将等于0x7f71!!!最简单的示例代码:#includeULONGNTAPIDriverEntry(PDRIVER_OBJECT,PUNICODE_STRING){intn=tolower(0x7f51);//nwillequal0x7f71!!!return0;}这是ntoskrnl.exe中to