mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-05-13 17:37:00 +00:00

the right namespace in C++11 mode. Teach the code to prefer the 'must be in precisely this namespace' diagnostic whenever that's true, and fix a defect which resulted in the -Wc++11-compat warning in C++98 mode sometimes being omitted. llvm-svn: 142329
25 lines
554 B
C++
25 lines
554 B
C++
// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s
|
|
namespace N1 {
|
|
|
|
template<typename T> struct X0 { }; // expected-note{{here}}
|
|
|
|
namespace Inner {
|
|
template<typename T> struct X1 { };
|
|
}
|
|
|
|
template struct X0<int>;
|
|
template struct Inner::X1<int>;
|
|
}
|
|
|
|
template<typename T> struct X2 { }; // expected-note{{here}}
|
|
|
|
template struct ::N1::Inner::X1<float>;
|
|
|
|
namespace N2 {
|
|
using namespace N1;
|
|
|
|
template struct X0<double>; // expected-error{{must occur in namespace 'N1'}}
|
|
|
|
template struct X2<float>; // expected-error{{at global scope}}
|
|
}
|