[cfe-commits] r167359 - /cfe/trunk/unittests/Lex/PPCallbacksTest.cpp

Dmitri Gribenko gribozavr at gmail.com
Sat Nov 3 14:10:32 PDT 2012


On Sat, Nov 3, 2012 at 10:58 PM, Benjamin Kramer
<benny.kra at googlemail.com> wrote:
> Author: d0k
> Date: Sat Nov  3 15:58:26 2012
> New Revision: 167359
>
> URL: http://llvm.org/viewvc/llvm-project?rev=167359&view=rev
> Log:
> Escape trigraphs in unittest.
>
> Modified:
>     cfe/trunk/unittests/Lex/PPCallbacksTest.cpp
>
> Modified: cfe/trunk/unittests/Lex/PPCallbacksTest.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Lex/PPCallbacksTest.cpp?rev=167359&r1=167358&r2=167359&view=diff
> ==============================================================================
> --- cfe/trunk/unittests/Lex/PPCallbacksTest.cpp (original)
> +++ cfe/trunk/unittests/Lex/PPCallbacksTest.cpp Sat Nov  3 15:58:26 2012
> @@ -222,27 +222,25 @@
>    ASSERT_EQ("<angled.h>", GetSourceString(Range));
>  }
>
> -#pragma clang diagnostic ignored "-Wtrigraphs"
> -
>  TEST_F(PPCallbacksTest, TrigraphFilename) {
>    const char* Source =
> -    "#include \"tri??-graph.h\"\n";
> +    "#include \"tri\?\?-graph.h\"\n";

Hi Benjamin,

Is this correct?  IIRC, "\?" is not a correct escape sequence.  The
correct way is to split the trigraph across multiple string literals
and rely on concatenation: "?" "?-"

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/



More information about the cfe-commits mailing list