[all-commits] [llvm/llvm-project] 27ea7d: Fix inconsistent availability attribute message st...

nigelp-xmos via All-commits all-commits at lists.llvm.org
Tue Dec 8 09:39:29 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 27ea7d0a6e0dc51e0214707bcc265fa6f9dc9bc6
      https://github.com/llvm/llvm-project/commit/27ea7d0a6e0dc51e0214707bcc265fa6f9dc9bc6
  Author: Nigel Perks <nigelp at xmos.com>
  Date:   2020-12-08 (Tue, 08 Dec 2020)

  Changed paths:
    M clang/lib/Parse/ParseDecl.cpp
    M clang/test/Parser/attr-availability.c

  Log Message:
  -----------
  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.




More information about the All-commits mailing list