[LLVMbugs] [Bug 19461] New: clang writes code after an #endif (same line)

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Apr 17 01:43:49 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=19461

            Bug ID: 19461
           Summary: clang writes code after an #endif (same line)
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: marco.servadei at clausmark.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 12391
  --> http://llvm.org/bugs/attachment.cgi?id=12391&action=edit
the clang config file

Given the following C++ code (note the 1 line code after the #endif):

#ifdef _DEBUG
    void hello( const char* message = "Hello, bugs." )
#else
    void hello( const char* message = "Hello, world." )
#endif
{ std::cout << message << std::endl; }


and using the .clang-format in attachment, clang produces the following (wrong)
code (note the code after the #endif):

#ifdef _DEBUG
void hello( const char* message = "Hello, bugs." )
#else
void hello( const char* message = "Hello, world." )
#endif { std::cout << message << std::endl; }

-- 
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/20140417/3222600d/attachment.html>


More information about the llvm-bugs mailing list