diff options
author | John McCall <rjmccall@apple.com> | 2013-02-20 01:54:26 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2013-02-20 01:54:26 +0000 |
commit | d4c3d66be70ae2d0bd828329022dc428cc277a1c (patch) | |
tree | b980077d0866c29bcf09476b73c6a1d234727872 /include/clang/Basic | |
parent | 975d52c759a0da21461668bac840bb5d21061d1b (diff) |
Add a new 'type_visibility' attribute to allow users to
control the visibility of a type for the purposes of RTTI
and template argument restrictions independently of how
visibility propagates to its non-type member declarations.
Also fix r175326 to not ignore template argument visibility
on a template explicit instantiation when a member has
an explicit attribute but the instantiation does not.
The type_visibility work is rdar://11880378
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175587 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic')
-rw-r--r-- | include/clang/Basic/Attr.td | 8 | ||||
-rw-r--r-- | include/clang/Basic/DiagnosticSemaKinds.td | 6 |
2 files changed, 12 insertions, 2 deletions
diff --git a/include/clang/Basic/Attr.td b/include/clang/Basic/Attr.td index e955367761..70217d2beb 100644 --- a/include/clang/Basic/Attr.td +++ b/include/clang/Basic/Attr.td @@ -732,6 +732,14 @@ def Visibility : InheritableAttr { ["Default", "Hidden", "Hidden", "Protected"]>]; } +def TypeVisibility : InheritableAttr { + let Clone = 0; + let Spellings = [GNU<"type_visibility">, CXX11<"clang", "type_visibility">]; + let Args = [EnumArgument<"Visibility", "VisibilityType", + ["default", "hidden", "internal", "protected"], + ["Default", "Hidden", "Hidden", "Protected"]>]; +} + def VecReturn : InheritableAttr { let Spellings = [GNU<"vecreturn">]; let Subjects = [CXXRecord]; diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 2bacb2cff9..b69bfda242 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -1849,7 +1849,8 @@ def warn_attribute_wrong_decl_type : Warning< "functions, methods, and parameters|classes|variables|methods|" "variables, functions and labels|fields and global variables|structs|" "variables, functions and tag types|thread-local variables|" - "variables and fields|variables, data members and tag types}1">, + "variables and fields|variables, data members and tag types|" + "types and namespaces}1">, InGroup<IgnoredAttributes>; def err_attribute_wrong_decl_type : Error< "%0 attribute only applies to %select{functions|unions|" @@ -1858,7 +1859,8 @@ def err_attribute_wrong_decl_type : Error< "functions, methods, and parameters|classes|variables|methods|" "variables, functions and labels|fields and global variables|structs|" "variables, functions and tag types|thread-local variables|" - "variables and fields|variables, data members and tag types}1">; + "variables and fields|variables, data members and tag types|" + "types and namespaces}1">; def warn_function_attribute_wrong_type : Warning< "'%0' only applies to function types; type here is %1">, InGroup<IgnoredAttributes>; |