Skip to content

<valarray>: magic static #1169

@AlexGuteniev

Description

@AlexGuteniev

Describe the bug
valarray potentially uses magic static

Command-line test case

#include <string>
#include <iostream>
#include <valarray>

int main()
{
	std::valarray<std::string> a{"strings", "are", "numeric", "types"};
	std::valarray<std::string> b = a.shift(2);
	for (std::string s : b) {
		std::cout << s << " ";
	}
}

Expected behavior
It works as expected.
But in C++17 where std::string constructor is not constexpr it should rely on magic static in debug mode:

__PURE_APPDOMAIN_GLOBAL static _Ty _Dflt;

STL version
e000d3f

Additional context
Probably not a real problem, only from lawyering point of view.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfixedSomething works now, yay!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions