[Lldb-commits] [PATCH] D112374: [clang] Implement ElaboratedType sugaring for types written bare

2022-09-15 Thread Abramo Bagnara via Phabricator via lldb-commits
Abramo-Bagnara reopened this revision.
Abramo-Bagnara added a comment.

These changes introduce a subtle bug in template instantiation of newly added 
ElaboratedType around TypedefType:

bool refersInstantiatedDecl(QualType T) in SemaTemplateInstantiate.cpp does not 
handle this ElaboratedType correctly then inhibiting the proper instantiation 
of TypedefType whose declaration has been subject to instantiation.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112374/new/

https://reviews.llvm.org/D112374

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D112374: [clang] Implement ElaboratedType sugaring for types written bare

2022-09-15 Thread Abramo Bagnara via Phabricator via lldb-commits
Abramo-Bagnara added a comment.

I have to doubly apologize:

1. my reference to refersInstantiatedDecl is completely wrong and I have been 
mislead by an old patch on my machine.
2. the problem despite being very real is independent by your changes

If you are still interested this is the repro followed by the explaination:

abramo@igor:/tmp$ cat a.c
template 
void p() {

  typedef int x;
  sizeof(x);

}

int main() {

  p();

}
abramo@igor:/tmp$ clang++-16 -cc1 -ast-dump -xc++ a.c
a.c:4:3: warning: expression result unused [-Wunused-value]

  sizeof(x);
  ^

a.c:4:3: warning: expression result unused [-Wunused-value]

  sizeof(x);
  ^

a.c:8:3: note: in instantiation of function template specialization 'p' 
requested here

  p();
  ^

TranslationUnitDecl 0x55df356fc8c8 <> 

| -TypedefDecl 0x55df356fd130 <>  implicit 
__int128_t '__int128'   |
| `-BuiltinType 0x55df356fce90 '__int128'   
   |
| -TypedefDecl 0x55df356fd1a0 <>  implicit 
__uint128_t 'unsigned __int128' |
| `-BuiltinType 0x55df356fceb0 'unsigned __int128'  
   |
| -TypedefDecl 0x55df356fd518 <>  implicit 
__NSConstantString '__NSConstantString_tag' |
| `-RecordType 0x55df356fd290 '__NSConstantString_tag'  
   |
| `-CXXRecord 0x55df356fd1f8 '__NSConstantString_tag'   
   |
| -TypedefDecl 0x55df356fd5b0 <>  implicit 
__builtin_ms_va_list 'char *'   |
| `-PointerType 0x55df356fd570 'char *' 
   |
| `-BuiltinType 0x55df356fc970 'char'   
   |
| -TypedefDecl 0x55df35742aa8 <>  implicit 
__builtin_va_list '__va_list_tag[1]'|
| `-ConstantArrayType 0x55df35742a50 '__va_list_tag[1]' 1   
   |
| `-RecordType 0x55df356fd6a0 '__va_list_tag'   
   |
| `-CXXRecord 0x55df356fd608 '__va_list_tag'
   |
| -FunctionTemplateDecl 0x55df35742ca8  line:2:6 p   
   |
|   
   | -TemplateTypeParmDecl 0x55df35742b00 
 col:19 typename depth 0 index 0  |
|   
   | -FunctionDecl 0x55df35742c08  line:2:6 p 'void ()'|
|   
   | `-CompoundStmt 0x55df35742ed0   |
|   
   |
   | -DeclStmt 0x55df35742e30 
|
|   
   |
   | `-TypedefDecl 
0x55df35742dd8  col:15 referenced x 'int' |
|   
   |
   | `-BuiltinType 
0x55df356fc9d0 'int' |
|   
   | `-UnaryExprOrTypeTraitExpr 0x55df35742eb0 
 'unsigned long' sizeof 'x':'int' |
| `-FunctionDecl 0x55df357430e8  line:2:6 used p 'void ()'  
   |
|   
   | -TemplateArgument type 'int'   
   |
|   
   | `-BuiltinType 0x55df356fc9d0 'int' 
   |
| `-CompoundStmt 0x55df35743328   
   |
|   
   | -DeclStmt 0x55df35743310|
|   
   | `-TypedefDecl 0x55