AutosarC++18_03-A2.13.6

Universal character names shall be used only inside character or string literals

Required inputs: IR

Rationale

Using universal-character-names to define a language identifier can be confusing for a developer and may be troublesome to use this identifier in the source code.

Example
//% $Id: A2-13-6.cpp 307578 2018-02-14 14:46:20Z michal.szczepankiewicz $
#include <string>
void F() {
  const std::string c = "\U0001f34c"; // Compliant
}

// non-compliant
void \U0001f615() {
  //
}

Possible Messages

Key

Text

Severity

Disabled

universal_character

Use of universal character names

None

False

Options

allow_in_comments

allow_in_comments : bool = False

Whether to allow universal character names in comments.
 

allow_in_string_literals

allow_in_string_literals : bool = True

Whether to allow universal character names in string/character literals.