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

S. B. Tam via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 24 11:43:12 PDT 2019


cpplearner added a comment.

(I am ensadc at bugzilla)

Does this cause regression in the following case?

  template<int *N>
  void f() {
      switch (N) case 0:; // should be diagnosed
      switch (0) case N:; // should be diagnosed
  }

Currently clang diagnoses these `switch` statements even if the template is not instantiated, GCC does not.

AFAIK both compilers are correct under [temp.res]/8, but clang's current behavior seems more helpful.


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

https://reviews.llvm.org/D61027





More information about the cfe-commits mailing list