Closed Bug 1324242 Opened 7 years ago Closed 7 years ago

Build failure with clang 3.9 and --enable-warnings-as-errors in gmock-internal-utils.h

Categories

(Firefox Build System :: General, defect)

defect
Not set
normal

Tracking

(firefox53 fixed)

RESOLVED FIXED
mozilla53
Tracking Status
firefox53 --- fixed

People

(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

4:27.17 In file included from Unified_cpp_tests_gtest0.cpp:2:
 4:27.17 In file included from /Users/ehsan/moz/src.landing/devtools/shared/heapsnapshot/tests/gtest/DeserializedNodeUbiNodes.cpp:10:
 4:27.17 In file included from ../../../../../../devtools/shared/heapsnapshot/tests/gtest/DevTools.h:15:
 4:27.17 In file included from ../../../../../dist/include/gmock/gmock.h:58:
 4:27.18 In file included from ../../../../../dist/include/gmock/gmock-actions.h:46:
 4:27.18 ../../../../../dist/include/gmock/internal/gmock-internal-utils.h:355:10: error: binding dereferenced null pointer to reference has undefined behavior [-Werror,-Wnull-dereference]
 4:27.18   return *static_cast<typename remove_reference<T>::type*>(NULL);
 4:27.18          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 4:27.18 ../../../../../dist/include/gmock/gmock-actions.h:78:22: note: in instantiation of function template specialization 'testing::internal::Invalid<JS::ubi::Node>' requested here
 4:27.18     return internal::Invalid<T>();
 4:27.18                      ^
 4:27.18 ../../../../../dist/include/gmock/gmock-actions.h:190:43: note: in instantiation of member function 'testing::internal::BuiltInDefaultValue<JS::ubi::Node>::Get' requested here
 4:27.18         internal::BuiltInDefaultValue<T>::Get() : *value_;
 4:27.18                                           ^
 4:27.18 ../../../../../dist/include/gmock/gmock-spec-builders.h:1437:34: note: in instantiation of member function 'testing::DefaultValue<JS::ubi::Node>::Get' requested here
 4:27.18     return DefaultValue<Result>::Get();
 4:27.18                                  ^
 4:27.18 ../../../../../dist/include/gmock/gmock-spec-builders.h:1334:22: note: in instantiation of member function 'testing::internal::FunctionMockerBase<JS::ubi::Node (const mozilla::devtools::DeserializedEdge &)>::PerformDefaultAction' requested here
 4:27.18         func_mocker->PerformDefaultAction(args, call_description));
 4:27.18                      ^
 4:27.18 ../../../../../dist/include/gmock/gmock-spec-builders.h:1450:26: note: in instantiation of function template specialization 'testing::internal::ActionResultHolder<JS::ubi::Node>::PerformDefaultAction<JS::ubi::Node (const mozilla::devtools::DeserializedEdge &)>' requested here
 4:27.18     return ResultHolder::PerformDefaultAction(this, args, call_description);
 4:27.18                          ^
 4:27.18 /Users/ehsan/moz/src.landing/devtools/shared/heapsnapshot/tests/gtest/DeserializedNodeUbiNodes.cpp:20:3: note: in instantiation of member function 'testing::internal::FunctionMockerBase<JS::ubi::Node (const mozilla::devtools::DeserializedEdge &)>::UntypedPerformDefaultAction' requested here
 4:27.18   MockDeserializedNode(NodeId id, const char16_t* typeName, uint64_t size)
 4:27.18   ^
 4:27.18 1 error generated.
 4:27.18


We need another workaround for bug 1142396.
Attachment #8819617 - Flags: review?(nfroyd) → review+
Assignee: nobody → ehsan
Pushed by eakhgari@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/7c3dadb99d3e
Ignore the -Wnull-dereference warning caused by gtest; r=froydnj
https://hg.mozilla.org/mozilla-central/rev/7c3dadb99d3e
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
Product: Core → Firefox Build System
See Also: → 1804375
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: