[PATCH] D69950: Reapply "Fix crash on switch conditions of non-integer types in templates"

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 5 11:49:23 PST 2019


rnk added a comment.

In D69950#1770138 <https://reviews.llvm.org/D69950#1770138>, @mstorsjo wrote:

> This (when reapplied in https://reviews.llvm.org/rG878a24ee244a24c39d1c57e9af2) broke compilation of code that earlier built fine. A reduced example:
>
>   namespace glslang {
>   class TPoolAllocator {
>     void operator=(TPoolAllocator);
>   };
>   template <class> class a {
>     TPoolAllocator *b;
>     void c() { allocator = *b; }
>     TPoolAllocator allocator;
>   };
>   } // namespace glslang
>


I fixed this particular code upstream:
https://github.com/KhronosGroup/glslang/pull/2010
I am not enough an expert to be sure, but I suspect this is in the area of "invalid, no diagnostic required", where this code is invalid, but a conforming C++ implementation could either reject or accept it. Now we reject it, and that seems better in the long term, even though it creates a fire drill in the short term. =(


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69950/new/

https://reviews.llvm.org/D69950





More information about the cfe-commits mailing list