]> granicus.if.org Git - clang/commitdiff
Check the implicit instantiation of a static data member of a class
authorDouglas Gregor <dgregor@apple.com>
Wed, 14 Oct 2009 21:33:19 +0000 (21:33 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 14 Oct 2009 21:33:19 +0000 (21:33 +0000)
template that has no out-of-line definition.

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

test/CXX/temp/temp.spec/temp.explicit/p1-emit.cpp

index f2282a23951f9931246193396a3bbc0cc3afe5cd..3938509961b49a842d1419c5b8f0dc0b2d744f8d 100644 (file)
@@ -19,8 +19,11 @@ template int X<int>::member1;
 template int X<int>::member2;
 
 // For implicit instantiation of 
-long& get(bool Cond) {
+long& get(bool Cond1, bool Cond2) {
   // CHECK: @_ZN1XIlE7member1E = weak global i64 0
   // CHECK: @_ZN1XIlE7member2E = weak global i64 17
-  return Cond? X<long>::member1 : X<long>::member2;
-}
\ No newline at end of file
+  // CHECK: @_ZN1XIlE7member3E = external global i64
+  return Cond1? X<long>::member1 
+       : Cond2? X<long>::member2
+              : X<long>::member3;
+}