diff options
author | David Majnemer <david.majnemer@gmail.com> | 2013-08-01 04:22:55 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2013-08-01 04:22:55 +0000 |
commit | 23252a3672853ded2e1a3eaec159c4f7e1dbc4ca (patch) | |
tree | 666c9591b39151a130962867ff7a9aa6c3c57a7f /clang/test/Parser/cxx-attributes.cpp | |
parent | b71782b7e510e6088b8970d20ebbf1bbcf662b98 (diff) | |
download | bcm5719-llvm-23252a3672853ded2e1a3eaec159c4f7e1dbc4ca.tar.gz bcm5719-llvm-23252a3672853ded2e1a3eaec159c4f7e1dbc4ca.zip |
Parse: Don't consider attributes of broken member declarators
ParseCXXClassMemberDeclaration was trying to use the result of
ActOnCXXMemberDeclarator to attach it to some late parsed attributes.
However when failures arise, we have no decl to attach to which
eventually leads us to a NULL pointer dereference.
While we are here, clean up the code a bit.
Fixes PR16765
llvm-svn: 187557
Diffstat (limited to 'clang/test/Parser/cxx-attributes.cpp')
-rw-r--r-- | clang/test/Parser/cxx-attributes.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/test/Parser/cxx-attributes.cpp b/clang/test/Parser/cxx-attributes.cpp index 5ea0ce22759..97380521f87 100644 --- a/clang/test/Parser/cxx-attributes.cpp +++ b/clang/test/Parser/cxx-attributes.cpp @@ -1,5 +1,4 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s -// expected-no-diagnostics class c { virtual void f1(const char* a, ...) @@ -8,3 +7,7 @@ class c { __attribute__ (( __format__(__printf__,2,3) )) {} }; +template <typename T> class X { + template <typename S> void X<S>::f() __attribute__((locks_excluded())); // expected-error{{nested name specifier 'X<S>::' for declaration does not refer into a class, class template or class template partial specialization}} \ + // expected-warning{{attribute locks_excluded ignored, because it is not attached to a declaration}} +}; |