From 8c02a241f4205f2b82e6981af26ac887e9073c08 Mon Sep 17 00:00:00 2001 From: Joerg Sonnenberger Date: Fri, 10 Aug 2012 10:57:52 +0000 Subject: Decrementing std::string::end is not portable, use array access instead. llvm-svn: 161659 --- clang/lib/CodeGen/CodeGenModule.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index a666415..3ae3c52 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -2636,7 +2636,7 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) { const std::string &S = getModule().getModuleInlineAsm(); if (S.empty()) getModule().setModuleInlineAsm(AsmString); - else if (*--S.end() == '\n') + else if (S.end()[-1] == '\n') getModule().setModuleInlineAsm(S + AsmString.str()); else getModule().setModuleInlineAsm(S + '\n' + AsmString.str()); -- cgit v1.1