diff options
author | Craig Scott <craig.scott@crascit.com> | 2019-07-01 11:49:18 (GMT) |
---|---|---|
committer | Craig Scott <craig.scott@crascit.com> | 2019-07-01 11:49:18 (GMT) |
commit | 32dae26975cab1f70f3bdf7078274615f3aa4040 (patch) | |
tree | d816805907e666fd8ad962e90d4170bdb0f2c0e5 | |
parent | 753373579e3dd8cf19f0fc18f4d9bec43a2d82e8 (diff) | |
parent | 822abf1265eacdffee37d3ed55e41425b6602e27 (diff) | |
download | CMake-32dae26975cab1f70f3bdf7078274615f3aa4040.zip CMake-32dae26975cab1f70f3bdf7078274615f3aa4040.tar.gz CMake-32dae26975cab1f70f3bdf7078274615f3aa4040.tar.bz2 |
Merge branch 'bug/19436' into release-3.15
Merge-request: !3497
-rw-r--r-- | Source/cmListCommand.cxx | 2 | ||||
-rw-r--r-- | Tests/RunCMake/list/POP_FRONT.cmake | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index 5474afa..1b01ea2 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -344,7 +344,7 @@ bool cmListCommand::HandlePopFrontCommand(std::vector<std::string> const& args) auto vi = varArgsExpanded.begin(); for (; vi != varArgsExpanded.end() && ai != args.cend(); ++ai, ++vi) { assert(!ai->empty()); - this->Makefile->AddDefinition(*ai, varArgsExpanded.front().c_str()); + this->Makefile->AddDefinition(*ai, vi->c_str()); } varArgsExpanded.erase(varArgsExpanded.begin(), vi); // Undefine the rest variables if the list gets empty earlier... diff --git a/Tests/RunCMake/list/POP_FRONT.cmake b/Tests/RunCMake/list/POP_FRONT.cmake index a2f8f3c..70f757a 100644 --- a/Tests/RunCMake/list/POP_FRONT.cmake +++ b/Tests/RunCMake/list/POP_FRONT.cmake @@ -77,3 +77,16 @@ endif() if(NOT test STREQUAL "two") message(FATAL_ERROR "`test` has unexpected value `${test}`") endif() + +# BUG 19436 +set(myList a b c) +list(POP_FRONT myList first second) +if(NOT first STREQUAL "a") + message(FATAL_ERROR "BUG#19436: `first` has unexpected value `${first}`") +endif() +if(NOT second STREQUAL "b") + message(FATAL_ERROR "BUG#19436: `second` has unexpected value `${second}`") +endif() +if(NOT myList STREQUAL "c") + message(FATAL_ERROR "BUG#19436: `myList` has unexpected value `${myList}`") +endif() |