Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Brace initialization does not trigger -Wdangling-gsl #95

Open
mgehre opened this issue Apr 28, 2020 · 1 comment
Open

Brace initialization does not trigger -Wdangling-gsl #95

mgehre opened this issue Apr 28, 2020 · 1 comment

Comments

@mgehre
Copy link
Owner

mgehre commented Apr 28, 2020

In

#include <string_view>
#include <string>

std::string f();

// Type your code here, or load an example.
int square(int num) {
    std::string_view a(f());
    std::string_view b{f()};
    std::string_view c;
    c = f();
    return num * num;
}

only a is diagosed, even though b and c have the same issue.
(see https://godbolt.org/z/dz67ZD)

fyi @Xazax-hun

@Xazax-hun
Copy link
Collaborator

Xazax-hun commented Apr 30, 2020

Thanks! I will try to look into it and fix it upstream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants