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

           Summary: clang mistakens a complete template type for an
                    incomplete type when its reference was used before its
                    definition
           Product: clang
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Semantic Analyzer
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


$ cat test.cc
template <typename T> class Foo;
Foo<int>* v;
Foo<int>& F() { return *v; }
template <typename T> class Foo {};
Foo<int> x;
$ clang-cc -fsyntax-only test.cc
test.cc:5:10: error: invalid use of incomplete type 'Foo<int>'
Foo<int> x;
         ^
test.cc:1:29: note: forward declaration of 'class Foo<int>'
template <typename T> class Foo;

This prevents clang from parsing Google Test.

Note that the following code, which doesn't involve templates, doesn't trigger
the bug:

class Bar;
Bar* b;
Bar& Func() { return *b; }
class Bar {};
Bar y;


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- 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