HomePhabricator

Fix inconsistent availability attribute message string literal check.

Authored by nigelp-xmos on Dec 8 2020, 9:33 AM.

Description

Fix inconsistent availability attribute message string literal check.

Function Parser::ParseAvailabilityAttribute checks that the message string of
an availability attribute is not a wide string literal. Test case
clang/test/Parser/attr-availability.c specifies that a string literal is
expected.

The code checked that the first token in a string concatenation is a string
literal, and then that the concatenated string consists of 1-byte characters.
On a target where wide character is 1 byte, a string concatenation "a" L"b"
passes both those checks, but L"b" alone is rejected. More generally, "a" u8"b"
passes the checks, but u8"b" alone is rejected.

So check isAscii() instead of character size.

Details

Committed
aaron.ballmanDec 8 2020, 9:33 AM
Parents
rG09f2f9605fba: [ScalarizeMaskedMemIntrinsic] Move from CodeGen into Transforms
Branches
Unknown
Tags
Unknown