[llvm-bugs] [Bug 27118] New: error: 'C' following the 'template' keyword does not refer to a template

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Mar 29 11:41:12 PDT 2016


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

            Bug ID: 27118
           Summary: error: 'C' following the 'template' keyword does not
                    refer to a template
           Product: clang
           Version: 3.8
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jtony at ca.ibm.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

The following reduced test case compiles successfully with g++ while clang
issues error message.

-bash-4.2$ cat reduce.cpp
template<typename T>
struct F { };

template<template<typename> class C>
struct S {
  ~S() {
    C<int>().C<int>::~C<int>();
  }
};

S<F> s ;


-bash-4.2$ ~/build/runnable/bin/clang++ reduce.cpp -c -v
clang version 3.8.0 (tags/RELEASE_380/final)
Target: powerpc64le-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/jtony/build/runnable/bin
Found candidate GCC installation: /usr/lib/gcc/ppc64le-redhat-linux/4.8.2
Found candidate GCC installation: /usr/lib/gcc/ppc64le-redhat-linux/4.8.3
Selected GCC installation: /usr/lib/gcc/ppc64le-redhat-linux/4.8.3
Candidate multilib: .;@m64
Selected multilib: .;@m64
 "/home/jtony/build/runnable/bin/clang" -cc1 -triple
powerpc64le-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-disable-llvm-verifier -main-file-name reduce.cpp -mrelocation-model static
-mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -fuse-init-array -target-cpu ppc64le -mfloat-abi hard
-target-abi elfv2 -target-linker-version 2.23.52.0.1 -v -dwarf-column-info
-debugger-tuning=gdb -coverage-file
/gsa/tlbgsa/home/j/t/jtony/workitems/127037/reduce.cpp -resource-dir
/home/jtony/build/runnable/bin/../lib/clang/3.8.0 -internal-isystem
/usr/lib/gcc/ppc64le-redhat-linux/4.8.3/../../../../include/c++/4.8.3
-internal-isystem
/usr/lib/gcc/ppc64le-redhat-linux/4.8.3/../../../../include/c++/4.8.3/ppc64le-redhat-linux
-internal-isystem
/usr/lib/gcc/ppc64le-redhat-linux/4.8.3/../../../../include/c++/4.8.3/backward
-internal-isystem /usr/local/include -internal-isystem
/home/jtony/build/runnable/bin/../lib/clang/3.8.0/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fdeprecated-macro -fdebug-compilation-dir
/gsa/tlbgsa/home/j/t/jtony/workitems/127037 -ferror-limit 19 -fmessage-length
135 -fno-signed-char -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -o reduce.o -x c++ reduce.cpp
clang -cc1 version 3.8.0 based upon LLVM 3.8.0 default target
powerpc64le-unknown-linux-gnu
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/ppc64le-redhat-linux/4.8.3/../../../../include/c++/4.8.3

/usr/lib/gcc/ppc64le-redhat-linux/4.8.3/../../../../include/c++/4.8.3/ppc64le-redhat-linux
 /usr/lib/gcc/ppc64le-redhat-linux/4.8.3/../../../../include/c++/4.8.3/backward
 /usr/local/include
 /home/jtony/build/runnable/bin/../lib/clang/3.8.0/include
 /usr/include
End of search list.
reduce.cpp:7:23: error: 'C' following the 'template' keyword does not refer to
a template
    C<int>().C<int>::~C<int>();
                      ^
reduce.cpp:11:6: note: in instantiation of member function 'S<F>::~S' requested
here



-bash-4.2$ g++ reduce.cpp -c
-bash-4.2$

-- 
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/20160329/41fd7a4d/attachment-0001.html>


More information about the llvm-bugs mailing list