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

            Bug ID: 17592
           Summary: Missing diagnose: declaration of 'T' shadows template
                    parameter
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]
    Classification: Unclassified

Please consider reopen bug-8302

$ cat test.cpp 
template <class T> struct S {
  void foo() {
    void T(void);
  }
};

S<int> s;
void  goo() { s.foo(); }


CLANG:

$ clang++ -target arm-none-linux-gnueabi -mfloat-abi=softfp -mfpu=neon
--sysroot=~/build_tools/gcc-4.6.1-cs/arm-2011.09 test.cpp -c -o test.o

G++:

$ arm-none-linux-gnueabi-g++ -mcpu=cortex-a9 test.cpp -c -o test.o
test.cpp: In member function 'void S<T>::foo()':
test.cpp:3:10: error: declaration of 'void T()'
test.cpp:1:11: error:  shadows template parm 'class T'

Seems to related to commit:

commit dd9459f8869f66409f7ea429053b453e33f6499c
    Author: Richard Smith <[email protected]>
    Date:   Tue Aug 13 18:18:50 2013 +0000

        Fix implementation of C11 6.2.7/4 and C++11 [dcl.array]p3:

        When a local extern declaration redeclares some other entity, the type
of that
        entity is merged with the prior type if the prior declaration is
visible (in C)
        or is declared in the same scope (in C++).

         - Make LookupRedeclarationWithLinkage actually work in C++, use it in
the right
           set of cases, and make it track whether it found a shadowed
declaration.
         - Track whether we found a declaration in the same scope (for C++)
including
           across serialization and template instantiation.

        git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188307
91177308-0d34-0410-b5e6-96231b3b80d8

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to