Issue 139677
Summary [Clang] Confusing error message for const cast between types with the same name
Labels clang, clang:frontend, clang:diagnostics
Assignees
Reporter hnrklssn
    ```
namespace foo {
  class Type {};
}
const foo::Type *bar();
class Type {};

const_cast<Type*>(bar()); // error: const_cast from 'const Type *' to 'Type *' is not allowed
```

When types have the same name we should emit diagnostics that refer to the fully qualified type names, to disambiguate. I'm sure other diagnostics suffer from the same problem, perhaps the DiagnosticsEngine or something could handle this automatically?
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to