[llvm-bugs] [Bug 30348] New: clang-format breaks user-defined literal for string_view (from experimental)

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Sep 11 19:23:29 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=30348

            Bug ID: 30348
           Summary: clang-format breaks user-defined literal for
                    string_view (from experimental)
           Product: clang
           Version: 3.9
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: arnetheduck at gmail.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org
    Classification: Unclassified

With std::experimental::string_view comes a new UDL, operator""sv -
clang-format however inserts an extra space when trying to use it, breaking
compile. Operator""s for std::string is processed correctly.

Before formatting:

cat test.cc
#include <string>
#include <experimental/string_view>

using namespace std::experimental;
using namespace std::string_literals;

const auto x = "broken"sv;
const auto y = "works"s;


After:
clang-format -style=Google test.cc 
#include <experimental/string_view>
#include <string>

using namespace std::experimental;
using namespace std::string_literals;

const auto x = "broken" sv;
const auto y = "works"s;

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160912/7f80f7c6/attachment.html>


More information about the llvm-bugs mailing list