scope. Thanks to Steven Watanabe for correcting me.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103210
91177308-0d34-0410-b5e6-
96231b3b80d8
// A using-declaration is a declaration and can therefore be used
// repeatedly where (and only where) multiple declarations are
// allowed.
- // That's only in file contexts.
- if (CurContext->getLookupContext()->isFileContext())
+ //
+ // That's in non-member contexts.
+ if (!CurContext->getLookupContext()->isRecord())
return false;
NestedNameSpecifier *Qual
template struct Derived<int>; // expected-note {{in instantiation of template class}}
}
+
+// Redeclarations are okay in a function.
+namespace test3 {
+ namespace N {
+ int f(int);
+ typedef int type;
+ }
+
+ void g() {
+ using N::f;
+ using N::f;
+ using N::type;
+ using N::type;
+ }
+}