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

            Bug ID: 36267
           Summary: Less than ideal handling of variable names in Cyrillic
                    alphabet
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows XP
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangb...@nondot.org
          Reporter: lminkov...@outlook.com
                CC: dgre...@apple.com, llvm-bugs@lists.llvm.org

The following example has a variable name in Russian:

int main() {
        int переменная=1;
        static_assert(переменная,"");
}

Wandbox.org compiles it with a correct error message:

prog.cc:3:16: error: static_assert expression is not an integral constant
expression
        static_assert(переменная,"");
                      ^~~~~~~~~~
prog.cc:3:16: note: read of non-const variable 'переменная' is not allowed in a
constant expression
prog.cc:2:6: note: declared here
        int переменная=1;
            ^
On Windows however, that message looks as follows:

test.cpp(3,16):  error: static_assert expression is not an integral constant
expression
       
static_assert(<U+043F><U+0435><U+0440><U+0435><U+043C><U+0435><U+043D><U+043D><U+0430><U+044F>,"");
                     
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.cpp(3,16):  note: read of non-const variable 'переменная' is not
allowed in a constant expression
test.cpp(2,6):  note: declared here
        int
<U+043F><U+0435><U+0440><U+0435><U+043C><U+0435><U+043D><U+043D><U+0430><U+044F>=1;
            ^
This happens because the Windows console needs to be set to the UTF-8 code page
to properly show Cyrillic characters.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to