diff options
author | David Majnemer <david.majnemer@gmail.com> | 2015-01-09 06:10:21 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2015-01-09 06:10:21 +0000 |
commit | 8c6db7056adf0779d708c1b4b8e7e01d7b3ccd92 (patch) | |
tree | 680e569808a419610d63c814d25e0903d9288219 /clang/test/SemaTemplate/instantiate-method.cpp | |
parent | 3c0f78a2fc31d0691dd20b8489d35928d87e998b (diff) | |
download | bcm5719-llvm-8c6db7056adf0779d708c1b4b8e7e01d7b3ccd92.tar.gz bcm5719-llvm-8c6db7056adf0779d708c1b4b8e7e01d7b3ccd92.zip |
Sema: Don't crash when specializing a global scope function in a class
We assumed that class-scope specializations would result in a
CXXMethodDecl for that class. However, globally qualified functions
will result in normal FunctionDecls.
llvm-svn: 225508
Diffstat (limited to 'clang/test/SemaTemplate/instantiate-method.cpp')
-rw-r--r-- | clang/test/SemaTemplate/instantiate-method.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/instantiate-method.cpp b/clang/test/SemaTemplate/instantiate-method.cpp index 4cc40af7e12..c2d4704bc02 100644 --- a/clang/test/SemaTemplate/instantiate-method.cpp +++ b/clang/test/SemaTemplate/instantiate-method.cpp @@ -195,3 +195,9 @@ namespace PR22040 { Foobar<int>::bazqux(3); // expected-error{{no member named 'bazqux' in }} } } + +template <typename> +struct SpecializationOfGlobalFnInClassScope { + template <> + void ::Fn(); // expected-error{{cannot have a qualified name}} expected-error{{cannot specialize a function}} +}; |