From 55213652486fb9d90d9ccaefd73d2c5f4eceed06 Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Fri, 22 Mar 2013 10:01:29 +0000 Subject: Make clang-format understand more line comments. Apparently one needs to set LangOptions.LineComment. Before "//* */" got reformatted to "/ /* */" as the lexer was returning the token sequence (slash, comment). This could also lead to weird other stuff, e.g. for people that like to using comments like: //**************** llvm-svn: 177720 --- clang/lib/Format/Format.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'clang/lib/Format/Format.cpp') diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp index 040fb39fb9d..40e980f67da 100644 --- a/clang/lib/Format/Format.cpp +++ b/clang/lib/Format/Format.cpp @@ -1643,6 +1643,7 @@ LangOptions getFormattingLangOpts() { LangOptions LangOpts; LangOpts.CPlusPlus = 1; LangOpts.CPlusPlus11 = 1; + LangOpts.LineComment = 1; LangOpts.Bool = 1; LangOpts.ObjC1 = 1; LangOpts.ObjC2 = 1; -- cgit v1.2.3