[llvm-bugs] [Bug 48834] New: clang-cl fails with "cannot compile this scalar expression yet"

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jan 21 03:47:47 PST 2021


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

            Bug ID: 48834
           Summary: clang-cl fails with "cannot compile this scalar
                    expression yet"
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: hans at chromium.org
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

Repro:

$ cat /tmp/a.ii
enum { a };
template <int> struct b { static const int c = a; };
namespace d {
template <int> class e {
protected:
  template <typename f> int g(f, int, void *);
};
template <class ad> class h : e<ad::c> {
  int i;
  void *j;
  virtual int k() { return g(this, i, j); }
};
}
template <typename> class m;
template <int l> class m<b<l>> : d::h<b<l>> {};
namespace d {
template <typename f, typename ag> void ah(ag) { f(0); }
}
using d::ah;
class n : m<b<a>> {
public:
  n(int) {}
};
void aj() { ah<n>(aj); }


$ clang -cc1 -triple x86_64-pc-windows-msvc19.22.27905 -emit-obj
-fms-extensions -fms-compatibility -fdelayed-template-parsing -x c++ /tmp/a.ii
/tmp/a.ii:11:28: warning: use of identifier 'g' found via unqualified lookup
into dependent bases of class templates is a Microsoft extension
[-Wmicrosoft-template]
  virtual int k() { return g(this, i, j); }
                           ^
                           this->
/tmp/a.ii:22:3: note: in instantiation of member function 'd::h<b<0>>::k'
requested here
  n(int) {}
  ^
/tmp/a.ii:6:29: note: must qualify identifier to find this declaration in
dependent base class
  template <typename f> int g(f, int, void *);
                            ^
/tmp/a.ii:11:28: error: cannot compile this scalar expression yet
  virtual int k() { return g(this, i, j); }
                           ^~~~~~~~~~~~~
Unexpected placeholder builtin type!
UNREACHABLE executed at
/work/llvm.monorepo/clang/lib/CodeGen/CodeGenTypes.cpp:597!

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210121/43d147fb/attachment.html>


More information about the llvm-bugs mailing list