Skip to content

Commit

Permalink
PR #261: Add cstddef include to fix nullptr_t reference
Browse files Browse the repository at this point in the history
issues #260

GitHub PR #261

Copybara import of the project:

  - 9ee01e3 add cstddef inlcude to fix nullptr reference by Alexander Mann <[email protected]>
  - 7c0d806 change nullptr_t to std::nullptr_t by Alexander Mann <[email protected]>

Closes #261

PiperOrigin-RevId: 305597016
  • Loading branch information
Alex-Mann authored and hzeller committed Apr 9, 2020
1 parent f2096ba commit 241da92
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions common/text/tree_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#ifndef VERIBLE_COMMON_TEXT_TREE_UTILS_H_
#define VERIBLE_COMMON_TEXT_TREE_UTILS_H_

#include <cstddef>
#include <functional>
#include <iosfwd>

Expand Down Expand Up @@ -112,7 +113,8 @@ const SyntaxTreeNode* CheckOptionalSymbolAsNode(const SPtr& symbol,

// Specialization for nullptr_t.
template <typename E>
const SyntaxTreeNode* CheckOptionalSymbolAsNode(const nullptr_t& symbol, E) {
const SyntaxTreeNode* CheckOptionalSymbolAsNode(const std::nullptr_t& symbol,
E) {
return nullptr;
}

Expand All @@ -127,7 +129,8 @@ const SyntaxTreeLeaf* CheckOptionalSymbolAsLeaf(const SPtr& symbol,

// Specialization for nullptr_t.
template <typename E>
const SyntaxTreeLeaf* CheckOptionalSymbolAsLeaf(const nullptr_t& symbol, E) {
const SyntaxTreeLeaf* CheckOptionalSymbolAsLeaf(const std::nullptr_t& symbol,
E) {
return nullptr;
}

Expand Down

0 comments on commit 241da92

Please sign in to comment.