OSDN Git Service

[StringRef] Add enable-if to StringLiteral.
authorZachary Turner <zturner@google.com>
Thu, 15 Dec 2016 19:02:43 +0000 (19:02 +0000)
committerZachary Turner <zturner@google.com>
Thu, 15 Dec 2016 19:02:43 +0000 (19:02 +0000)
commit18e2348b674a6b5477462c3d4437ebf50528f1a8
tree93cd74d12780f0ba67fe8cf0c3a0499760c33c48
parent94ab0f269931f8386c5c746e486db36c441340e3
[StringRef] Add enable-if to StringLiteral.

to prevent StringLiteral from being created with a non-literal
char array, clang has a macro enable_if() that can be used
in such a way as to guarantee that the constructor is disabled
unless the length fo the string can be computed at compile time.

This only works on clang, but at least it should allow bots
to catch abuse of StringLiteral.

Differential Revision: https://reviews.llvm.org/D27780

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289853 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ADT/StringRef.h