[cfe-commits] r161211 - in /cfe/trunk: lib/AST/ASTContext.cpp lib/Sema/SemaDeclCXX.cpp test/Sema/warn-documentation.cpp
Dmitri Gribenko
gribozavr at gmail.com
Thu Aug 2 13:49:51 PDT 2012
Author: gribozavr
Date: Thu Aug 2 15:49:51 2012
New Revision: 161211
URL: http://llvm.org/viewvc/llvm-project?rev=161211&view=rev
Log:
Attaching comments to declarations: handle using-declaration.
Modified:
cfe/trunk/lib/AST/ASTContext.cpp
cfe/trunk/lib/Sema/SemaDeclCXX.cpp
cfe/trunk/test/Sema/warn-documentation.cpp
Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=161211&r1=161210&r2=161211&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Thu Aug 2 15:49:51 2012
@@ -95,8 +95,8 @@
SourceLocation DeclLoc;
if (isa<ObjCMethodDecl>(D) || isa<ObjCContainerDecl>(D) ||
isa<ObjCPropertyDecl>(D) ||
- isa<FunctionTemplateDecl>(D) ||
- isa<ClassTemplateDecl>(D) || isa<ClassTemplateSpecializationDecl>(D))
+ isa<RedeclarableTemplateDecl>(D) ||
+ isa<ClassTemplateSpecializationDecl>(D))
DeclLoc = D->getLocStart();
else
DeclLoc = D->getLocation();
Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=161211&r1=161210&r2=161211&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Thu Aug 2 15:49:51 2012
@@ -6649,6 +6649,7 @@
if (!Redeclaration)
PushOnScopeChains(NewND, S);
+ ActOnDocumentableDecl(NewND);
return NewND;
}
Modified: cfe/trunk/test/Sema/warn-documentation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/warn-documentation.cpp?rev=161211&r1=161210&r2=161211&view=diff
==============================================================================
--- cfe/trunk/test/Sema/warn-documentation.cpp (original)
+++ cfe/trunk/test/Sema/warn-documentation.cpp Thu Aug 2 15:49:51 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -Wdocumentation -Wdocumentation-pedantic -verify %s
+// RUN: %clang_cc1 -std=c++11 -fsyntax-only -Wdocumentation -Wdocumentation-pedantic -verify %s
// expected-warning at +1 {{expected quoted string after equals sign}}
/// <a href=>
@@ -389,64 +389,73 @@
// expected-warning at +1 {{empty paragraph passed to '\brief' command}}
/// \brief\brief Aaa
+using test_attach29 = test_attach28<int>;
+
+// expected-warning at +1 {{empty paragraph passed to '\brief' command}}
+/// \brief\brief Aaa
/// \tparam T Aaa
template<typename T, typename U>
-class test_attach29 { };
+class test_attach30 { };
// expected-warning at +1 {{empty paragraph passed to '\brief' command}}
/// \brief\brief Aaa
/// \tparam T Aaa
template<typename T>
-class test_attach29<T, int> { };
+class test_attach30<T, int> { };
// expected-warning at +1 {{empty paragraph passed to '\brief' command}}
/// \brief\brief Aaa
template<>
-class test_attach29<int, int> { };
+class test_attach30<int, int> { };
+
+// expected-warning at +1 {{empty paragraph passed to '\brief' command}}
+/// \brief\brief Aaa
+template<typename T>
+using test_attach31 = test_attach30<T, int>;
// expected-warning at +1 {{empty paragraph passed to '\brief' command}}
/// \brief\brief Aaa
/// \tparam T Aaa
template<typename T, typename U, typename V>
-class test_attach30 { };
+class test_attach32 { };
// expected-warning at +1 {{empty paragraph passed to '\brief' command}}
/// \brief\brief Aaa
/// \tparam T Aaa
template<typename T, typename U>
-class test_attach30<T, U, int> { };
+class test_attach32<T, U, int> { };
// expected-warning at +1 {{empty paragraph passed to '\brief' command}}
/// \brief\brief Aaa
/// \tparam T Aaa
template<typename T>
-class test_attach30<T, int, int> { };
+class test_attach32<T, int, int> { };
// expected-warning at +2 {{empty paragraph passed to '\brief' command}}
// expected-warning at +2 {{template parameter 'T' not found in the template declaration}}
/// \brief\brief Aaa
/// \tparam T Aaa
template<>
-class test_attach30<int, int, int> { };
+class test_attach32<int, int, int> { };
// expected-warning at +1 {{empty paragraph passed to '\brief' command}}
/// \brief\brief Aaa
-class test_attach31 {
+class test_attach33 {
// expected-warning at +1 {{empty paragraph passed to '\brief' command}}
/// \brief\brief Aaa
/// \tparam T Aaa
template<typename T, typename U>
- void test_attach32(T aaa, U bbb);
+ void test_attach34(T aaa, U bbb);
};
template<typename T>
-class test_attach33 {
+class test_attach35 {
// expected-warning at +2 {{empty paragraph passed to '\brief' command}}
// expected-warning at +2 {{template parameter 'T' not found in the template declaration}}
/// \brief\brief Aaa
/// \tparam T Aaa
template<typename TT, typename UU>
- void test_attach34(TT aaa, UU bbb);
+ void test_attach36(TT aaa, UU bbb);
};
// expected-warning at +2 {{empty paragraph passed to '\brief' command}}
@@ -454,29 +463,29 @@
/// \brief\brief Aaa
/// \tparam T Aaa
template<> template<>
-void test_attach33<int>::test_attach34(int aaa, int bbb) {}
+void test_attach35<int>::test_attach36(int aaa, int bbb) {}
template<typename T>
-class test_attach35 {
+class test_attach37 {
// expected-warning at +2 {{empty paragraph passed to '\brief' command}}
// expected-warning at +2 {{'\tparam' command used in a comment that is not attached to a template declaration}}
/// \brief\brief Aaa
/// \tparam T Aaa
- void test_attach36(int aaa, int bbb);
+ void test_attach38(int aaa, int bbb);
};
// expected-warning at +1 {{empty paragraph passed to '\brief' command}}
/// \brief\brief Aaa
/// \tparam T Aaa
template<typename T>
-void test_attach35<T>::test_attach36(int aaa, int bbb) {}
+void test_attach37<T>::test_attach38(int aaa, int bbb) {}
// expected-warning at +2 {{empty paragraph passed to '\brief' command}}
// expected-warning at +2 {{template parameter 'T' not found in the template declaration}}
/// \brief\brief Aaa
/// \tparam T Aaa
template<>
-void test_attach35<int>::test_attach36(int aaa, int bbb) {}
+void test_attach37<int>::test_attach38(int aaa, int bbb) {}
// PR13411, reduced. We used to crash on this.
More information about the cfe-commits
mailing list