[LLVMbugs] [Bug 20459] New: Dependent template-id parsing fails to match angle brackets in certain comma delimited contexts

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Jul 26 07:26:02 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=20459

            Bug ID: 20459
           Summary: Dependent template-id parsing fails to match angle
                    brackets in certain comma delimited contexts
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: hstong at ca.ibm.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Clang chokes on commas in template argument lists in dependent template-ids in
certain contexts.

### SOURCE:
$ cat dependentTemplateComma.cc
template <typename EncTraits> struct A {
   void foo(int = EncTraits::template TypeEnc<int, int>::val);
};


### COMPILER INVOCATION AND OUTPUT:
$ /build/clang/workdir/Debug+Asserts/bin/clang++ dependentTemplateComma.cc -c
dependentTemplateComma.cc:2:55: error: expected ')'
   void foo(int = EncTraits::template TypeEnc<int, int>::val);
                                                      ^
dependentTemplateComma.cc:2:12: note: to match this '('
   void foo(int = EncTraits::template TypeEnc<int, int>::val);
           ^
dependentTemplateComma.cc:2:50: error: expected '>'
   void foo(int = EncTraits::template TypeEnc<int, int>::val);
                                                 ^
2 errors generated.


### EXPECTED BEHAVIOUR:
Clean compile.


### COMPILER VERSION INFO:
$ /build/clang/workdir/Debug+Asserts/bin/clang++ -v
clang version 3.5.0 (trunk 212631)
Target: x86_64-unknown-linux-gnu
Thread model: posix
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.2
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Candidate multilib: .;@m64
Selected multilib: .;@m64

-- 
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/20140726/c3787742/attachment.html>


More information about the llvm-bugs mailing list