Skip to content

Commit

Permalink
Explicitly specify the default constructor to FieldPath (#773)
Browse files Browse the repository at this point in the history
Xcode prior to 8.3 does not accept an explicitly defaulted constructor
(`= default`) for the purposes of default initializing a const object.

This fixes a build failure under Xcode 8.2:

```
Firestore/core/src/firebase/firestore/model/field_path.cc:144:26: error: default initialization of an object of const type 'const firebase::firestore::model::FieldPath' without a user-provided default constructor
  static const FieldPath empty_path;
```
  • Loading branch information
wilhuff committed Feb 8, 2018
1 parent 2ad24f8 commit ff3b5ca
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Firestore/core/src/firebase/firestore/model/field_path.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ namespace model {
*/
class FieldPath : public impl::BasePath<FieldPath> {
public:
FieldPath() = default;
// Note: Xcode 8.2 requires explicit specification of the constructor.
FieldPath() : impl::BasePath<FieldPath>() {
}

/** Constructs the path from segments. */
template <typename IterT>
FieldPath(const IterT begin, const IterT end) : BasePath{begin, end} {
Expand Down

0 comments on commit ff3b5ca

Please sign in to comment.