[llvm-bugs] [Bug 38296] New: A potential problem to compile Chromium

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jul 24 17:26:02 PDT 2018


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

            Bug ID: 38296
           Summary: A potential problem to compile Chromium
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: zhonghao at pku.org.cn
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

A user complained that a previous gcc cannot compile Chromium. The bug report
is:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69753

The reduced code is as follow:

class A {
public:
 template <typename> void As();
 static A *FromWebContents();
 template <typename... Ts>
 A *FromWebContents(Ts...);
};
template <typename T> class B : A {
 void FromWebContents() {
 auto guest = A::FromWebContents();
 guest->As<T>();
 }
};

After fixing the bug, the latest g++ accepts the code. I tried clang++, and it
rejects the code:

code3.cpp:11:9: error: use 'template' keyword to treat 'As' as a dependent
template name
     guest->As<T>();
            ^
            template 
    1 error generated.

Potentially, clang++ may fail to compile Chromium?

-- 
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/20180725/9612aa30/attachment.html>


More information about the llvm-bugs mailing list