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

            Bug ID: 20283
           Summary: read-only variable is not assignable warning could be
                    clearer
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

With this code:

class T {
  int a;
  int *c;

  void resetC() const {
    c = &a;
  }
};

T t;

you get:

dzur:~> ~/builds/build-llvm/Debug+Asserts/bin/clang -c foo.cpp
foo.cpp:6:7: error: read-only variable is not assignable
    c = &a;
    ~ ^
1 error generated.

which is perfectly correct - but doesn't really help me know why it isn't
assignable. Perhaps we could point to the const on the function, or something
similar?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to