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

            Bug ID: 47789
           Summary: Clang 10 disallows modifying const member by an unused
                    member function in a templated class; while Clang 9
                    allows it
           Product: clang
           Version: 10.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected],
                    [email protected]

Created attachment 24042
  --> https://bugs.llvm.org/attachment.cgi?id=24042&action=edit
Sample program demonstrating the issue

I'm not sure this is a bug or not.

- The sample program has a class template with a const member.
- A member function attempts to modify the member.
- The program does not actually use that member function
- Clang 9 and gcc compile the code fine, while clang 10 gives an error.

I see this behavior only with template classes, so I was thinking it may be a
case of SFINAE (in which case clang 10 should not be giving an error). However,
some others on cpplang slack are of the opinion this is a case of IFNDR, and
clang 10 is basically issuing eager diagnostics.

Code is here https://godbolt.org/z/r9sT44

and also attached to this report

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to