☰
  • 首页
  • 规则分类
  • 项目介绍
search
•••

窄字符串与宽字符串连接

C++-Undefined-Behavior-9
目录 › next › previous

示例:

auto* x = L"123" "456";    // Undefined in C++03
auto* y = L"123" "456";    // A wide string in C++11

C++03 规定宽字符串与窄字符串连接会导致未定义的行为。C++11 规定一个字符串有前缀一个没有的话,结果以有前缀的为准,其他情况由实现定义。

依据

ISO/IEC 14882:2003 2.13.4(3)-undefined ISO/IEC 14882:2011 2.14.5(13)-implementation

规则

ID_literal_hybridConcat
Copyright©2024 360 Security Technology Inc., Licensed under the Apache-2.0 license.