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

            Bug ID: 26891
           Summary: C: Feature-request: diagnostic for assignments of
                    read-only locations (eg string literals)
           Product: clang
           Version: 3.8
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangb...@nondot.org
          Reporter: andrey....@gmail.com
                CC: llvm-bugs@lists.llvm.org
    Classification: Unclassified

This is a feature-request for Clang to emit a diagnostic related to assignment
to string-only location, as is seen in the test-case. 
The fact that this is UB via const-violation is obvious, but gcc emits a
diagnostic since 4.8 or earlier.

Test case:

int main() {
"abc"[1] = '1';
}

-- 
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