<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=http://email.email.llvm.org/c/eJytU01v1DAQ_TXJZdQosfOxOeRQWlVUQgjBSnCdxJONwYkX2-my_HrGaZeqiAuiUhJr5o0nz2-ee6vO3X0A7cERGnOGI-plXA0ECxMuyhAEmo8GAzHkcKZADvQCg8HlkMFngoVIxfKT01yEZrY-QJgIPFfDYBXBaB1gb9cAEoKeyW-Z_VPj_flIH9DNtzSYRNzAe7vE1AW-QMB0nvf8AWbwlhz_nd9wskA_kHHyibxO8tskf_pOIRy3nLjj56DDtPbZYGcOjHm4LFdHZ7_SEDjsje15Kdp2EKqWo6oLUYpmHKiuVbPrC5LUVzusWhoLarh00yU20nHjJ3Iajf6JQduF4-tP-4-Eilw2HI-JkO-KXBT5FS-yqF-DaSMHtSPRoipUW9WtoHKX97tqGHoaqRJMv95RO_yF6YxPy0XbC0dRt0xR7F4y3E9R8HnlYfcElgfufsueAaNntomK3vBTHIu37AavZ23Qba7w20D1woYacYib7uGES4heQv8N9BhdxDt1rHwsXNBEo3q7MIYBTtFgq1GsbRMAlQKEHj1Fe3rW7w4eyaaqk6qVLaa4hsm67mZacfmuv6xtujrT_bPc2vuV7SXuKlmWeTp1Y9lKasQwinIsmnZXo6qk6puqpLEqqiE12JPxXVK9SYR41F5ej87ysRbFqaS6Tf-fiO5ELkReiCZvJbsqQ2bQ17WMzq2qQiZlziPWJot9MusOqeu2lv168Awa7YN_BllFfeAbvvFmhkEHswXsZI7hJqofxzDhA70Q_9WvOE8z3U7bbUf9Bfbpjj0>53440</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [AST] Could we have a base class for TemplateTypeParmDecl, NonTypeTemplateParmDecl and TemplateTemplateParmDecl?
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang:frontend
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          ChuanqiXu9
      </td>
    </tr>
</table>

<pre>
    It is really painful to handle template parameter in clang. We need to write almost the same code for about 3 times for TemplateTypeParmDecl, NonTypeTemplateParmDecl and TemplateTemplateParmDecl. Here are two examples:

https://github.com/llvm/llvm-project/blob/199c2d63fd612427fce66d78b1e3eb58a59ef1e7/clang/lib/Serialization/ASTReader.cpp#L10210-L10316

https://github.com/llvm/llvm-project/blob/73cd8e29ad1d95692e480b85ccbefe5212468e9c/clang/lib/Sema/SemaTemplate.cpp#L2690-L2816

There must be other examples. They indeed share some similar codes and interfaces. I want to ask if there is an internal reason that we couldn't add a base class? 

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJytVN9r3DAM_muSF9GQOL8uD3noWsoKY4z1YHuVY-XizYlvttPb7a-fnPZWOvYyKCQR1ifJn6SPSKvO_X0A7cERGnOGI-plXA0ECxMuyhAEmo8GAzHkcKZADvQCg8HlkMEXgoVIxfCT0xyEZrY-QJgIPEfDYBXBaB2gtGuAEoKeyW-e_XPh_flIn9DNtzSYRNzAR7tE1wW-QMB0XnL-AjN4T45v5zecLNBPZJx8Ul4n-W2SP3-nEI6bT9zxc9BhWmU22JkPxjxezNXR2W80BD5KYyWbousGoZpyVE0hKtGOAzWNaneyoJJkvcO6o7GglkO3ucRCOiY-kNNo9C8M2i58vn7YfyZU5LLheExE-aHIRZFfsSmL5i2YtuWgdiQ6VIXq6qYTVO1yuauHQdJItWD6zY664R9MZ3w2l9leOIqmY4pi95rhfooDn1detiSwvHD3Z-wZMHpmmaioDT_FtXjLavB61gbdpgq_LVQvLKgRh5h0DydcQtQS-u-gx6giztQx8ilwQROF6u3CGAY4RYGtRvFs2wCoFCBI9BTl6Xl-d_BENlV9qbqywzToYKhP6ne8iqS-hZuYHutM-Eivst9co0wnXZ3p_3u32vuVtSzu6rKq8nTqhShR5GKQOStTdq0QJGTb1JUSeVOpXWpQkvGxzUSIp0WX16OzPMNFsYs7T3XPJUReiDbvShZghm1dyaYpo8jruiiTKmc1aJNFOpl1h9T1GzO5HjyDRvvgX0AemT7wz2C7levjGibr-ptpxeWH_rp26dZHvzXxGyo2d-8">