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

            Bug ID: 37830
           Summary: ICE with typeof applied to template parameter
                    dependent expression
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangb...@nondot.org
          Reporter: zhong...@pku.org.cn
                CC: dgre...@apple.com, llvm-bugs@lists.llvm.org

The code is as follow:

# 1 "foo.cc"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "foo.cc"

template<typename T>
void Bar(T t, typeof(T() - T()) s) {}

int main() {
        char* a;
        int i;
        Bar(a, i);
        return 0;
}

clang++ produces no error message, when it compiles the above code. gcc++
produces an error message. In particular, it warns that "void Bar(T t,
typeof(T() - T()) s) {}" shall be changed to "void Bar(T t, decltype(T() - T())
s) {}". 

Shall clang++ present similar error messages?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to