mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-14 13:08:29 +00:00
Note namespace and static recommendations in C++ style guide (#1041)
This commit is contained in:
1 parent
086834d63a
commit
eda43faa5a
16 files changed
+48
-49
No files matched your search
@@ -13,13 +13,11 @@
|
||||
|
||||
namespace Carbon {
|
||||
|
||||
namespace {
|
||||
|
||||
constexpr llvm::StringRef TripleQuotes = "\"\"\"";
|
||||
constexpr llvm::StringRef HorizontalWhitespaceChars = " \t";
|
||||
static constexpr llvm::StringRef TripleQuotes = "\"\"\"";
|
||||
static constexpr llvm::StringRef HorizontalWhitespaceChars = " \t";
|
||||
|
||||
// Carbon only takes uppercase hex input.
|
||||
auto FromHex(char c) -> std::optional<char> {
|
||||
static auto FromHex(char c) -> std::optional<char> {
|
||||
if (c >= '0' && c <= '9') {
|
||||
return c - '0';
|
||||
}
|
||||
@@ -30,12 +28,10 @@ auto FromHex(char c) -> std::optional<char> {
|
||||
}
|
||||
|
||||
// Creates an error instance with the specified `message`.
|
||||
llvm::Expected<std::string> MakeError(llvm::Twine message) {
|
||||
static auto MakeError(llvm::Twine message) -> llvm::Expected<std::string> {
|
||||
return llvm::createStringError(llvm::inconvertibleErrorCode(), message);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
auto UnescapeStringLiteral(llvm::StringRef source, bool is_block_string)
|
||||
-> std::optional<std::string> {
|
||||
std::string ret;
|
||||
|
||||
Reference in new issue
Block a user