Quantcast
Channel: Clang: no warning with -Wdangling-gsl and curly braces initialization, bug in clang? - Stack Overflow
Browsing latest articles
Browse All 30 View Live

Answer by Adrian Mole for Clang: no warning with -Wdangling-gsl and curly...

This is a bug in clang's diagnosis. The use of curly braces in your last two cases does not 'fix' the dangling pointer issue.By way of 'confirmation', the Code Analysis tool (static analyser) in Visual...

View Article


Clang: no warning with -Wdangling-gsl and curly braces initialization, bug in...

Consider the following snippet:#include <string>#include <string_view>int main() { auto str = std::string{}; auto sv1 = std::string_view(str +"!"); // <- warning :) std::string_view...

View Article
Browsing latest articles
Browse All 30 View Live